Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
i am using following code in xx.svc and i called Login Methode through ajax in aspx page.. but it gives sometimes Internal server error 500.. How to resolve this problem.. anybody know pls help me..
C#
[OperationContract]
              [WebInvoke(Method = "POST",
                  BodyStyle = WebMessageBodyStyle.WrappedRequest,
                  ResponseFormat = WebMessageFormat.Xml
              )]
              public string LogIn(string UserID, string Password)
              {

                  try
                  {
                      string strUserId = UserID;
                      string strPassword = Password;
                      int rVal;
                      Hashtable inParams = new Hashtable();
                      inParams.Add("@uid", strUserId);
                      inParams.Add("@Password", strPassword);
                      string result = "";
                      DataSet objdetDataSet = DataHelper.GetDataSet(connString, "CheckUserExists", out rVal, inParams);
                      if (objdetDataSet.Tables[0].Rows.Count > 0)
                      {
                          result = objdetDataSet.GetXml();


                          System.Web.HttpContext.Current.Session["UserId"] = objdetDataSet.Tables[0].Rows[0].ItemArray[0].ToString();
                         
                        
                      }

                      return result;

                  }
                  catch (Exception ex)
                  {

                      return ex.Message;
                  }
                  finally
                  {
                  }
              }
Posted
Updated 30-Jul-12 22:03pm
v2

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900