Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
Dim username As String
Dim pwd As String
username = Login1.UserName
pwd = Login1.Password
Dim strConn As String
strConn = WebConfigurationManager.ConnectionStrings("userdatabase").ConnectionString
Dim Conn As New OleDbConnection(strConn)
Conn.Open()
Dim sqlUserName As String
sqlUserName = "SELECT Usersss,Passwordsss FROM Registers "
sqlUserName &= " WHERE (Usersss ='" & username & "')"
sqlUserName &= " AND (Passwordsss ='" & pwd & "')"
Dim com As New OleDbCommand(sqlUserName, Conn)
Dim CurrentName As String
CurrentName = CStr(com.ExecuteScalar)
If CurrentName <> "" Then
Session("UserAuthentication") = username
Session.Timeout = 1
Response.Redirect("StartPage.aspx")
Else
Session("UserAuthentication") = ""
End If
End Sub