Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnLogin.Click
Dim command As New SqlClient.SqlCommand
Dim adapter As New SqlClient.SqlDataAdapter
Dim dataset As New DataSet
'set up the connectiom
Dim connection As SqlConnection = New SqlConnection("Data Source=GIPL-K****IZ;Initial Catalog=Employee;Integrated Security=True")
'select the query
command.CommandText = "SELECT password from employee where username = '" & txtUsername.Text & "' "
'open the connection
connection.Open()
adapter.SelectCommand = command
adapter.Fill(dataset,0) //am getting error in valid dataset
Dim count = dataset.Tables(0).Rows.Count
If count > 0 Then
redirect.show()
Me.hide()
Else
Response.Write("<script language='Javascript'>alert('Please enter correct username and password');</script>")
txtUsername.Text = ""
txtPassword.Text = ""
End If
End Sub333can anybody help me!
Dim command As New SqlClient.SqlCommand
Dim adapter As New SqlClient.SqlDataAdapter
Dim dataset As New DataSet
'set up the connectiom
Dim connection As SqlConnection = New SqlConnection("Data Source=GIPL-K****IZ;Initial Catalog=Employee;Integrated Security=True")
'select the query
command.CommandText = "SELECT password from employee where username = '" & txtUsername.Text & "' "
'open the connection
connection.Open()
adapter.SelectCommand = command
adapter.Fill(dataset,0) //am getting error in valid dataset
Dim count = dataset.Tables(0).Rows.Count
If count > 0 Then
redirect.show()
Me.hide()
Else
Response.Write("<script language='Javascript'>alert('Please enter correct username and password');</script>")
txtUsername.Text = ""
txtPassword.Text = ""
End If
End Sub333can anybody help me!