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
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