dataset question

  • Thread starter Thread starter Avon
  • Start date Start date
A

Avon

Hi there,

I am very sorry for my not perfect English.

I've got very simple question. Is it possible to have stored procedure with
2 result tables and then from my application to refer to this tables by ado.

Something likes that:

Select * from aaa

Select * from bbb



And then in my application

SqlDataAdapter adapter=new SqlDataAdapter();

DataSet MyDataSet=new DataSet();

adapter.Fill(MyDataSet, "aaa");

adapter.Fill(MyDataSet, "bbb");



Basically I want to receive with 1 connection to the database 2 tables.



If is possible haw I can do it,

And if is not possible is there any other way I can do it?

Thanks in advance
 
SqlDataReader has a NextResult method for that purpose.

you could use more extended method
[C#]
protected virtual int Fill(
DataSet dataSet,
string srcTable,
IDataReader dataReader,
int startRecord,
int maxRecords
);to populate DataSet simply by creating SqlDataREader and then calling NextResult between 2 Fills.George.

Hi there,

I am very sorry for my not perfect English.

I've got very simple question. Is it possible to have stored procedure with
2 result tables and then from my application to refer to this tables by ado.

Something likes that:

Select * from aaa

Select * from bbb



And then in my application

SqlDataAdapter adapter=new SqlDataAdapter();

DataSet MyDataSet=new DataSet();

adapter.Fill(MyDataSet, "aaa");

adapter.Fill(MyDataSet, "bbb");



Basically I want to receive with 1 connection to the database 2 tables.



If is possible haw I can do it,

And if is not possible is there any other way I can do it?

Thanks in advance
 
Back
Top