ASP.NET

Moderators: None (Apply to moderate this forum)
Number of threads: 1733
Number of posts: 3304

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Problems with parameters, can anyone help? Posted by jbmarsh80 on 23 Oct 2002 at 6:24 AM
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



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.