I apologize if this question has been asked before, but I did not see it anywhere. I am trying to create a login webform in ASP.NET. The user information is stored in a Sybase database (tblLogin). I need some help creating the login script. Here's what I need help with:
Private Function CheckLogin()
SiteID = txtSiteID.Text
Password = txtPassword.Text
Dim dbPassword
Dim strSql As String
strSql = "Select * From tblLogin Where Client_ID = " & SiteID & ""
Dim connLogin As Odbc.OdbcConnection = New Odbc.OdbcConnection("DSN=SybaseTest;UID=dba;PWD=SQL"
connLogin.Open()
Dim adapterLogin As Odbc.OdbcDataAdapter = New Odbc.OdbcDataAdapter(strSql, connLogin)
Dim TestDataSet As DataSet = New DataSet
adapterLogin.Fill(TestDataSet, "Password"
dbPassword = TestDataSet.Tables("Password".Rows(0)("Password"
If Password = dbPassword Then
'redirect to main screen
else
'msgbox stating bad password
End If
End Function
This function works fine if the site id is inthe database, but if it is not, it blows up. I'm sure there is a simple answer (and probably a simpler way of verifying the login information) - Thanks
Zack
Private Function CheckLogin()
SiteID = txtSiteID.Text
Password = txtPassword.Text
Dim dbPassword
Dim strSql As String
strSql = "Select * From tblLogin Where Client_ID = " & SiteID & ""
Dim connLogin As Odbc.OdbcConnection = New Odbc.OdbcConnection("DSN=SybaseTest;UID=dba;PWD=SQL"
connLogin.Open()
Dim adapterLogin As Odbc.OdbcDataAdapter = New Odbc.OdbcDataAdapter(strSql, connLogin)
Dim TestDataSet As DataSet = New DataSet
adapterLogin.Fill(TestDataSet, "Password"
dbPassword = TestDataSet.Tables("Password".Rows(0)("Password"
If Password = dbPassword Then
'redirect to main screen
else
'msgbox stating bad password
End If
End Function
This function works fine if the site id is inthe database, but if it is not, it blows up. I'm sure there is a simple answer (and probably a simpler way of verifying the login information) - Thanks
Zack