How to call select stored procedure using WCF Service?
The data display in xml format
This is my code
Interface:
[WebInvoke(ResponseFormat = WebMessageFormat.Xml)]
[OperationContract]
DataSet Loadstatus();
Implementation:
public DataSet Loadstatus1()
{
SqlConnection con = new SqlConnection(@"Data Source=ASHDEVBTS-1;Initial Catalog=Sampath;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Clear();
cmd.CommandText = "SelectLoad";
//cmd.Parameters.AddWithValue("@LoadId", LoadId);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "ShipperLoadStatus");
return ds;
}
Stored procedure:
create procedure SelectLoad
as
begin
select LoadId,TrailerNum,DriverName,VehicleNumber from ShipperLoadStatus
end
I am not getting any error
But not getting data from database
plz what is the mistake?