ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Return multiple record sets from stored procedure using Web API in AngularJS<p>Finally, found the solution. Using dataset or datatable is always recommended, because it gives control to the code. Because, unspecified row data will not displayed. Dataset and datatable will eliminate those unspecified row data and display only the specified data.</p> <p><span style="text-decoration: underline;"><em><strong>Controller.cs (First ouput table data):</strong></em></span></p> <pre class="brush: csharp"> [HttpGet] [ActionName(&#34;GetPendingDetails&#34;)] public string GetInvoiceDetails(DataSet ds) { SqlConnection myConnection = new SqlConnection(); myConnection.ConnectionString = ConfigurationManager.ConnectionStrings[&#34;ERPConnectionString&#34;].ConnectionString; SqlCommand sqlCmd = new SqlCommand(); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandText = &#34;GET_WH_RECEIPT_AUTO&#34;; sqlCmd.Connection = myConnection; SqlDataAdapter sda = new SqlDataAdapter(sqlCmd); ds = new DataSet(); string jsonString = string.Empty; myConnection.Open(); sda.Fill(ds); myConnection.Close(); jsonString = JsonConvert.SerializeObject(ds.Tables[0]); return jsonString; }</pre> <p><span style="text-decoration: underline;"><em><strong>Controller.cs (Second ouput table data):</strong></em></span></p> <pre class="brush: csharp"> [HttpGet] [ActionName(&#34;GetInvoiceProperties&#34;)] public string GetInvoiceProperties(DataSet ds) { SqlConnection myConnection = new SqlConnection(); myConnection.ConnectionString = ConfigurationManager.ConnectionStrings[&#34;ERPConnectionString&#34;].ConnectionString; SqlCommand sqlCmd = new SqlCommand(); sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandText = &#34;GET_WH_RECEIPT_AUTO&#34;; sqlCmd.Connection = myConnection; SqlDataAdapter sda = new SqlDataAdapter(sqlCmd); ds = new DataSet(); string jsonString = string.Empty; myConnection.Open(); sda.Fill(ds); myConnection.Close(); jsonString = JsonConvert.SerializeObject(ds.Tables[1]); return jsonString; }</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/186008/Return-multiple-record-sets-from-stored-procedure-using-Web-API-in-AngularJS/https://www.aspforums.net:443/Threads/186008/Return-multiple-record-sets-from-stored-procedure-using-Web-API-in-AngularJS/Wed, 12 Jun 2019 03:42:55 GMT