Hi,
I have been trying to get this database application to work for hours, but am unable to correctly get this page to work. It's a simple logon page, but the intID always returns 0. the stored procedure spValidate user is the SQL statement:
SELECT FamilyID
FROM dbo.FamilyInfo
WHERE (email = @email) AND (password = @password)
When i run the stored procedure locally and manually input the email and password, it works fine. Here is the code i am using:
dim objcmd as OleDbCommand = new OleDbCommand _
("spValidateUser", Conn)
objCmd.CommandType = CommandType.StoredProcedure
dim objParam as OleDbParameter
objParam = objCmd.Parameters.Add("@email", oleDbType.BSTR)
objParam.Value = tbemail.Text
objParam = objCmd.Parameters.Add("@Password", OleDbType.BSTR)
objParam.Value = tbPassword.Text
try
objCmd.Connection.Open
intId = CType(objCmd.ExecuteScalar, Integer)
objCmd.Connection.Close
Catch ex as OleDbException
lblMessage.Text = ex.Message
end try
if intID <> 0 then
response.Cookies("Family").Value = intID
response.Redirect("member_loggedin.aspx")
else
lblMessage.Text = intID & "<font color=Red> Sorry, invalid username or password! </font><p>"
end if