Dim reader As SqlDataReader Dim id As String = Me.loginid.Text Dim pass As String = Me.password.Text Dim st As String = ConfigurationManager.ConnectionStrings("contructionConnectionStringlap").ToString Dim con As New Data.SqlClient.SqlConnection(st) Dim q As String = "select * from login where login_id = '" & id & "' and password = '" & pass & "' " Dim com As New Data.SqlClient.SqlCommand(q, con) con.Open() reader = com.ExecuteReader() If reader.HasRows Then reader.Read() Dim role As String = (reader("role")).ToString() If role = "Admin" Then Response.Redirect("welcomeemployee.aspx") End If Else If MsgBox("Incorrect Password Or UserID", MsgBoxStyle.RetryCancel, "Warning") = MsgBoxResult.Cancel Then password.Text = "" loginid.Text = "" End If End If reader.Close() con.Close() End Sub
If MsgBox("Incorrect Password Or UserID", MsgBoxStyle.RetryCancel, "Warning") = MsgBoxResult.Cancel Then password.Text = "" loginid.Text = "" End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)