Newbie question on filling typed dataset

  • Thread starter Thread starter Toby Groves
  • Start date Start date
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.
 
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.
 
Back
Top