How do I store multiple results from a stored procedure into a dataset?
问题 How do I combine to result sets from a StoredProcedure into one dataset in ASP.NET? Below is my code in asp.net SqlDataAdapter adap = new System.Data.SqlClient.SqlDataAdapter("sp_Home_MainBanner_TopStory",con); adap.SelectCommand.CommandType = CommandType.StoredProcedure; adap.SelectCommand.Parameters.AddWithValue("@rows", 9); DataSet DS = new DataSet(); adap.Fill(DS, "Table1"); adap.Fill(DS, "Table2"); GridView1.DataSource = DS.Tables["Table2"]; GridView1.DataBind(); Even if there were two