i have developed a service in wcf say datatable method
i am not able to access in client app
public DataTable Grid(WcfThreetierData obj1)
{
con.Open();
cmd = new SqlCommand("PROC_WCF_GRID", con);
cmd.CommandType = CommandType.StoredProcedure;
da = new SqlDataAdapter(cmd);
da.Fill(dt);
con.Close();
return dt;
}
rest all the methods are able access
The error is
"An error occurred while receiving the HTTP response to http://gunnala-pc/wcfthreetier/wcfthreetier.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down)."
please suggest
Sanjeeb LenkaPosted Sep 21, 2013, 8:09 AM
try this one
DataTable dt=new DataTable("Paging");
instead of
DataTable dt=new DataTable();
Hariom PrasadPosted Sep 21, 2013, 7:45 AM
Thanks for the post
but i have already declared datatable in the general declaration
Datatable dt=new datatable();
i can see the data in the return type of
public datatable Grid(WcfThreetierData obj1) ie return dt;
wen the method is passing from service to client, error is occured
can u tell me what is the error which i have posted
thanks
Sanjeeb LenkaPosted Sep 21, 2013, 6:17 AM
try below code
public DataTable Grid(WcfThreetierData obj1)
{
DataTable dt=new DataTable("Paging");// just pass a string here as your choice
con.Open();
cmd = new SqlCommand("PROC_WCF_GRID", con);
cmd.CommandType = CommandType.StoredProcedure;
da = new SqlDataAdapter(cmd);
da.Fill(dt);
con.Close();
return dt;
}