Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Error...

Reply
Thread Tools

Error...

 
 
Wong CS
Guest
Posts: n/a
 
      03-10-2005
Dear developer,

I have experience this error message:

System.NullReferenceException: Object reference not set to an instance of an
object. at GreenBid_mobile.LoginProc.ValidateLogin(String EmailAdd, String
Password) in c:\inetpub\wwwroot\greenbid_mobile\loginproc.asmx. cs:line 108

Here is the code:
public string ValidateLogin(string EmailAdd, string Password)

{

int result;

sqlCommand1.Parameters["@usr_Email"].Value=EmailAdd;

sqlCommand1.Parameters["@usr_PW"].Value=Password;


try

{

sqlCommand1.Connection.Open();

result=(int)(sqlCommand1.Parameters["@usr_session"].Value);


}

catch(Exception ex)

{

return (ex.ToString());

}


sqlCommand1.Connection.Close();



if(result==1)

return "Login Successfully";

else

return "Login Failed";



the error is fall on
"result=(int)(sqlCommand1.Parameters["@usr_session"].Value)", my database
connectivity no problem.. but the problem keep on occur.

Thanks advance whoever tell me the problem.. thanks



cheers,

Wong CS


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments