I have a stored procedure in SQL that when it executes, it returns two select queries, so basically 2 tables (see image below)
In my controller, this is the example of how I get the value of the first table return
My controller:
SqlDataReader dr = cmd.ExecuteReader();
string column1= "";
string column2= "";
string column3= "";
string column4= "";
if (dr.Read())
{
column1= dr["Column1"].ToString();
column2= dr["Column2"].ToString();
column3= dr["Column3"].ToString();
column4= dr["Column4"].ToString();
}
return Json(new { success = true, column1 = column1 , column2 = column2 , column3 = column3 , column4 = column4 }, JsonRequestBehavior.AllowGet);
How to get the result of the 2nd table? I tried like the approach above but it doesn't work and it doesn't return the first table result anymore. Thanks for help