Error...

Discussion in 'ASP .Net Web Services' started by Wong CS, Mar 10, 2005.

  1. Wong CS

    Wong CS Guest

    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
     
    Wong CS, Mar 10, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hfk0
    Replies:
    2
    Views:
    21,678
  2. JavaQueries
    Replies:
    1
    Views:
    3,676
    John C. Bollinger
    Mar 1, 2005
  3. Balaji
    Replies:
    3
    Views:
    10,115
  4. Bishop
    Replies:
    1
    Views:
    792
    Bishop
    Feb 24, 2007
  5. juvi
    Replies:
    3
    Views:
    1,054
    Alexey Smirnov
    Jan 22, 2009
Loading...

Share This Page