Error...

W

Wong CS

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top