Try cn.Open() cmd = New OleDbCommand("select *from Login where uname='" & TextBox4.Text & "' and pwd='" & TextBox3.Text & "'", cn) rs = cmd.ExecuteReader If rs.HasRows Then Session("validated") = True Response.Redirect("home.aspx") Else Label4.Visible = True Label4.Text = "Wrong UserName or Password, Try Again!!" TextBox3.Focus() End If cn.Close() Catch ex As Exception cn.Close() End Try If TextBox4.Text = "" Then Label4.Visible = True Label4.Text = "Please Enter UserName" ElseIf TextBox3.Text = "" Then Label4.Visible = True Label4.Text = "Please Enter Password" TextBox3.Focus() End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)