I have created below webservice in .asmx format.but when i execute this service using "HttpJob",it returns as "Internal Server Error".Please check below code and advise how to do that...
WebService:-
[WebMethod(Description = "EmpDet")]
public DataSet GetEmpDetails(string StrEmpCode)
{
DataSet dataset = new DataSet();
dataset = Db.SetCommand("Select M.EmpName,D.deptname Department from Arind.Dbo.HrEmpMas M Join Arind.Dbo.Department D On D.DeptCode = M.deptcode Where (M.EmpCode = '" + StrEmpCode + "') And (M.OnRolls = 'Y') ").ExecuteDataSet();
Db.Close();
Db.Dispose();
return dataset;
}
Basic4Android:-
Dim job1 As HttpJob
job1.Initialize("Job1", Me)
job1.PostString("http://103.76.188.138:85/StageEntry/StageEntry.asmx/GetEmpDetails","StrEmpCode=4550")
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Msgbox(Job.GetString,"")
Log(Job.GetString)
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
WebService:-
[WebMethod(Description = "EmpDet")]
public DataSet GetEmpDetails(string StrEmpCode)
{
DataSet dataset = new DataSet();
dataset = Db.SetCommand("Select M.EmpName,D.deptname Department from Arind.Dbo.HrEmpMas M Join Arind.Dbo.Department D On D.DeptCode = M.deptcode Where (M.EmpCode = '" + StrEmpCode + "') And (M.OnRolls = 'Y') ").ExecuteDataSet();
Db.Close();
Db.Dispose();
return dataset;
}
Basic4Android:-
Dim job1 As HttpJob
job1.Initialize("Job1", Me)
job1.PostString("http://103.76.188.138:85/StageEntry/StageEntry.asmx/GetEmpDetails","StrEmpCode=4550")
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Msgbox(Job.GetString,"")
Log(Job.GetString)
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release