Dear developer,
I have experience this error message:
System.NullRefe renceException: Object reference not set to an instance of an object. at GreenBid_mobile .LoginProc.Vali dateLogin(Strin g EmailAdd, String Password) in c:\inetpub\wwwr oot\greenbid_mo bile\loginproc. asmx.cs:line 108
Here is the code:
public string ValidateLogin(s tring EmailAdd, string Password)
{
int result;
sqlCommand1.Par ameters["@usr_Email "].Value=EmailAdd ;
sqlCommand1.Par ameters["@usr_PW"].Value=Password ;
try
{
sqlCommand1.Con nection.Open();
result=(int)(sq lCommand1.Param eters["@usr_sessi on"].Value);
}
catch(Exception ex)
{
return (ex.ToString()) ;
}
sqlCommand1.Con nection.Close() ;
if(result==1)
return "Login Successfully";
else
return "Login Failed";
the error is fall on "result=(int)(s qlCommand1.Para meters["@usr_sessi on"].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.NullRefe renceException: Object reference not set to an instance of an object. at GreenBid_mobile .LoginProc.Vali dateLogin(Strin g EmailAdd, String Password) in c:\inetpub\wwwr oot\greenbid_mo bile\loginproc. asmx.cs:line 108
Here is the code:
public string ValidateLogin(s tring EmailAdd, string Password)
{
int result;
sqlCommand1.Par ameters["@usr_Email "].Value=EmailAdd ;
sqlCommand1.Par ameters["@usr_PW"].Value=Password ;
try
{
sqlCommand1.Con nection.Open();
result=(int)(sq lCommand1.Param eters["@usr_sessi on"].Value);
}
catch(Exception ex)
{
return (ex.ToString()) ;
}
sqlCommand1.Con nection.Close() ;
if(result==1)
return "Login Successfully";
else
return "Login Failed";
the error is fall on "result=(int)(s qlCommand1.Para meters["@usr_sessi on"].Value)", my database connectivity no problem.. but the problem keep on occur.
Thanks advance whoever tell me the problem.. thanks
cheers,
Wong CS