I am following the code in a previous thread and cannot access SQL database. See attached login.aspx and login.aspx.vb files. Database file is a simple "Users" filw with AutoID, username, email and password. What am I doing wrong? Any help is greatly appreciated.
I'm sorry, I did my best to wade through your code but I'm not much on VB. Hopefully someone with more in-depth knowledge of VB and SessionStates will be able to toss back an answer on this one for you.
rty this code for login it properly works for me as i updated for you.
Dim strConn As String
strConn = WebConfigurationManager.ConnectionStrings("iPesha").ConnectionString
Dim Conn As New SqlConnection(strConn)
Dim sqlUserName As String= "SELECT UserName,Password FROM Users "
cmd =new sqlCommand(sqlUserName,con)
dim dr as SqldataReader
if dr.HasRows=true then
If dr(1).ToString() = username And dr(2).ToString() = pwd Then
Session("UserAuthentication") = username
elseif dr.HasRows=False then
Session("UserAuthentication") = ""