0

Protected Sub Button5_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim connection As SqlConnection = New SqlConnection("server=(local); Database = Bookstore; integrated Security=True")
Dim CSP As SqlCommand = New SqlCommand()
'Dim Cust As SqlCommand = New SqlCommand()

CSP.Connection = connection
CSP.CommandText = ("select CusID,CusPassword from CusromerDetail where CusUsername = " & "'" & txtUserName.Text & "' and CusPassword = '" & txtUserPass.Text & "'")

'Cust.Connection = connection
'Cust.CommandText = ("select CustEmail,CustPassword from Customer where CustEmail = " & "'" & txtUserName.Text & "' and CustPassword = '" & txtUserPass.Text & "'")

connection.Open()

If txtUserName.Text.StartsWith("cs") Then
Dim csr As SqlDataReader = CSP.ExecuteReader
If csr.Read = True Then
Session.Contents("username") = txtUserName.Text
Response.Redirect("AboutUs.aspx")
Else
Response.Redirect("Login.aspx")
End If
End If
connection.Close()
End Sub

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by dnanetwork
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.