Newbie question on filling typed dataset

T

Toby Groves

Hi all,

First post here, and I'm a total noob at all this .NET stuff so bear
with me :)

Got a query on filling a typed dataset. If I create a typed dataset
containing two tables in a master/detail relationship, such as Orders
and OrderDetails, how do I go about filling this with a data adapter?

I'm not quite sure whether I have to fill each table in the dataset
separately using two different data adapters, or whether it can all be
done in one step via a single data adapter, and if so how?

Any help appreciated, many thanks.
 
M

Miha Markic [MVP C#]

Hi Toby,

Toby Groves said:
Hi all,

First post here, and I'm a total noob at all this .NET stuff so bear
with me :)

Don't worry.
Got a query on filling a typed dataset. If I create a typed dataset
containing two tables in a master/detail relationship, such as Orders
and OrderDetails, how do I go about filling this with a data adapter?

I'm not quite sure whether I have to fill each table in the dataset
separately using two different data adapters, or whether it can all be
done in one step via a single data adapter, and if so how?

You can do it in both ways. Either you define two adapters with respective
selectcommands and fill master first and then detail, or create an adapter
with selectcommand that holds both selects (master first) if data provider
supports it.
See
Populating a DataSet from a DataAdapter
..net help topic.
 

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

Top