dataset question

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
 
G

George

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,588
Members
45,093
Latest member
Vinaykumarnevatia00

Latest Threads

Top