Sub Activation() Dim activationKey As String = Date.Now.Millisecond * Date.Now.Second * 3 * Year(Now) + Date.Now.Day * 77 'Generates Activation Key Try strCon = System.Configuration.ConfigurationManager.AppSettings("ConnectX").ToString() strQry = "Insert INTO tActivation (sUsername,ActivationCode,ActivationStatus,DateRegistered,DateActivated,AccountEmail) Values('" & userID & "','" & activationKey & "','" & 0 & "','" & Now & "','" & Now & "','" & txtEmail.Text & "')" cn = New SqlConnection(strCon) cn.Open() Com = New SqlCommand(strQry, cn) Com.ExecuteNonQuery() Com.Dispose() cn.Close() SendToMail(activationKey) 'Calls a Procedure to send the key using SMTP server Catch ex As Exception End Try End Sub
Dim cn as ....
cn.Close()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)