Last post Feb 08, 2011 03:47 PM by rmaiya
Feb 03, 2011 03:16 PM|gkarthik|LINK
I am using a sql stored procedure which returns multiple result sets. By default Sql Datasource is binding the first result set to gridview. I want the second result set to be binded. I browsed all the properties in Sql datasource but could not find one
to set this. Please help me out.
sql datasource control stored procedure
Feb 03, 2011 03:37 PM|rmaiya|LINK
SQLDataSource supports one resultset only. What you can do is use regular dataset and then from the codebehind you can say
GridView1.DataSource = myDataSet.Tables
Feb 05, 2011 07:31 AM|ravikanth192|LINK
its better get rid of result set
use only dataset which can accept multiple record .
its an disconnected architecture which is good for its performance also
Feb 07, 2011 11:48 AM|gkarthik|LINK
I thought of doing in that way. But then I may loose the functionality of sorting and paging. So, is there any way, I can get these features with out extra code.
Thanks for the response Raghu
Feb 08, 2011 03:47 PM|rmaiya|LINK
Ok. Use ObjectDataSource instead of SQLDataSource and write a static method like this below. In this way you dont loose paging functionality etc.
<asp:GridView ID="GridView1" runat="server" Width="100%" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="projectId" DataSourceID="ObjectDataSource1" />
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetAllPDRS_PVT_Project_ReviewType_Sections"
public static DataTable GetAllPDRS_PVT_Project_ReviewType_Sections()
string sqlCommand = "usp_PDRS_PVT_Project_ReviewType_SectionSelect";
DataTable dt = DAL.ExecuteDataTable(sqlCommand, 0, 0, 0, true);
// Write the code for cleanup