tags:

views:

26

answers:

1

Hello, what is the recommended data access strategy for the following environment: single stored procedure, many parameters, asp.net 4.0, sql server 2008, and the stored proc returns 11 different recordsets, all of which get displayed in various different elements too complex and specific to be handled by server controls. Thoughts?

A: 

I would query the SP from the code behind to retrieve a SqlDataReader. Then dissect the data reader and assign the results to the asp.net data controls;

SqlDataReader myDataReader = com.ExecuteReader();

GridView1.DataSource = myDataReader;
GridView1.DataBind();

myDataReader.NextResult();

GridView2.DataSource = myDataReader;
GridView2.DataBind();
iain