Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As AuthenticateEventArgs) Dim Authenticated As Boolean = False Authenticated = SiteLevelCustomAuthenticationMethod(Login1.UserName, Login1.Password) e.Authenticated = Authenticated If Authenticated = True Then Response.Redirect("Home.aspx") End If End Sub Private Function SiteLevelCustomAuthenticationMethod(ByVal UserName As String, ByVal Password As String) As Boolean Dim boolReturnValue As Boolean = False ' Insert code that implements a site-specific custom ' authentication method here. ' This example implementation always returns false. Dim strConnection As String = "server=dtpxp-skumari;database=master;uid=sa;pwd=;" Dim Connection As New SqlConnection(strConnection) Dim strSQL As String = "Select * From Employee" Dim command As New SqlCommand(strSQL, Connection) Dim Dr As SqlDataReader Connection.Open() Dr = command.ExecuteReader() While Dr.Read() If (UserName = Dr("name").ToString()) And (Password = Dr("Password").ToString()) Then boolReturnValue = True End If Dr.Close() Return boolReturnValue End While End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.