G
Guest
I'm a newbie to VB.NET and ASP.NET (as you'll see by my code). However, I'm not able to get a simple process to work. I'm trying to retrieve a record and then check to see if the 'accountstat' column of the DB is set to 'inactive'. I can't, however, get it to compare correctly. Here's the code
Sub Sign_In(s As Object, e As EventArgs
If IsValid The
Dim conPubs As SqlConnectio
Dim cmdSelectRecord As SqlComman
Dim dtrUser As SqlDataReade
conPubs = New SqlConnection("Server=moses;UID=sa;PWD=webdev;Database=testDB"
conPubs.Open(
cmdSelectRecord = new SqlCommand("Select * from siteusers where email='" & txtUsername.text & "' and password='"& txtPassword.Text &"'", conPubs
dtrUser = cmdSelectRecord.ExecuteReader(
If dtrUser.Read The
If dtrUser("accountstat") = "inactive" The
txtInvalid.text = "Your account has not been activated. Follow the instructions sent to you via email to activate your account.
Els
' Session("uid") = dtrUser("uid"
' Response.Redirect(Session("Referer")
End I
Els
txtInvalid.text = "Invalid email address and/or password
session("forgotEmail")=txtUsername.tex
End I
dtrUser.Close(
conPubs.Close(
End I
End Sub
Sub Sign_In(s As Object, e As EventArgs
If IsValid The
Dim conPubs As SqlConnectio
Dim cmdSelectRecord As SqlComman
Dim dtrUser As SqlDataReade
conPubs = New SqlConnection("Server=moses;UID=sa;PWD=webdev;Database=testDB"
conPubs.Open(
cmdSelectRecord = new SqlCommand("Select * from siteusers where email='" & txtUsername.text & "' and password='"& txtPassword.Text &"'", conPubs
dtrUser = cmdSelectRecord.ExecuteReader(
If dtrUser.Read The
If dtrUser("accountstat") = "inactive" The
txtInvalid.text = "Your account has not been activated. Follow the instructions sent to you via email to activate your account.
Els
' Session("uid") = dtrUser("uid"
' Response.Redirect(Session("Referer")
End I
Els
txtInvalid.text = "Invalid email address and/or password
session("forgotEmail")=txtUsername.tex
End I
dtrUser.Close(
conPubs.Close(
End I
End Sub