I have created a stored procedure in Sql Server which uses a cursor and
returns multiple identical(schemawise) resultset. When this stored
procedure is used to populate a dataset, naturally multiple datatables are
created. I need to merge the data avaiable in these multiple tables of the
dataset in one table so that I can display the entire data at once in a
datagrid.
Following the code snippet which I am using to merge though in vain.

DataSet dsSummary1 = new DataSet();
DataSet dsSummary;
DataView dvSummary;
dsSummary = BRErrors.GetSummary();
for(int i=0;i <= dsSummary.Tables.Count -1;i++)
{
 dsSummary1.Merge(dsSummary.Tables[i]);
}

dvSummary = dsSummary1.Tables[0].DefaultView;

datagridSummary.DataSource = dvSummary;
datagridSummary.DataBind();

Would appreciate a quick response.

Thank you for your time.

Reply via email to