Hi
How to pass ref parameter through HTTP Get method in Rest Web api and get the result in postman.
How to return the no of records as well as Dataset in Rest Web api.plz help.
C#
public JsonResult GetRecords(string Code,ref int noofrecords
{
DataSet ds = new DataSet();
try
{
SqlDataAdapter da = new SqlDataAdapter("GetRecords", con);
con.Open();
da.SelectCommand.CommandType = CommandType.StoredProcedure;
SqlParameter ret = new SqlParameter();
ret.Direction = ParameterDirection.ReturnValue;
da.SelectCommand.Parameters.Add("@Code", SqlDbType.VarChar, 20).Value = Code;
da.SelectCommand.Parameters.Add(ret);
da.Fill(ds, "StudentList");
noofrecords = (int)ret.Value;
}
catch (Exception) {
}
return Json(ds);
}
Sachin SinghRank #66 · 26.2K reputationPosted Jun 14, 2021, 6:48 AM EDT
Kiran MohantyRank #821 · 2.8K reputationPosted Jun 14, 2021, 5:55 AM EDT