Filling a table using multiple adapters

  • Thread starter Thread starter naisongarvasis
  • Start date Start date
N

naisongarvasis

hi,
I have a dataset with 2 tables(Header and Detail)
I am using 10 adapters to fill the dataset(5 for Header and 5 for
detail).
All the adapters are having same columns(schema) as the tables in the
dataset.

While filling the dataset using the adapters one by one, i am not
getting the expected data. First adapter is filling the table with all
the data, second adapter is filling the table with two row(expected is
11 row) and so on..

but if i am filling the dataset table with only one adapter at a time
then i am getting the expected result.


i am adding the code wich i am using to fill the dataset.

thank you
Naison



dsDayBook.Clear();

daGVHeader.Fill (dsDayBook.Header);
daGVDetail.Fill (dsDayBook.Detail);

daPVHeader.Fill (dsDayBook.Header);
daPVDetail.Fill (dsDayBook.Detail);

daRVHeader.Fill (dsDayBook.Header);
daRVDetail.Fill (dsDayBook.Detail);

daPIHeader.Fill (dsDayBook.Header);
daPIDetail.Fill (dsDayBook.Detail);

daRIHeader.Fill (dsDayBook.Header);
daRIDetail.Fill (dsDayBook.Detail);

grid.DataSource = dsDayBook;
grid.DataBind() ;
 
hi,
I have a dataset with 2 tables(Header and Detail)
I am using 10 adapters to fill the dataset(5 for Header and 5 for
detail).
All the adapters are having same columns(schema) as the tables in the
dataset.

While filling the dataset using the adapters one by one, i am not
getting the expected data. First adapter is filling the table with all
the data, second adapter is filling the table with two row(expected is
11 row) and so on..

but if i am filling the dataset table with only one adapter at a time
then i am getting the expected result.


i am adding the code wich i am using to fill the dataset.

thank you
Naison



dsDayBook.Clear();

daGVHeader.Fill (dsDayBook.Header);
daGVDetail.Fill (dsDayBook.Detail);

daPVHeader.Fill (dsDayBook.Header);
daPVDetail.Fill (dsDayBook.Detail);

daRVHeader.Fill (dsDayBook.Header);
daRVDetail.Fill (dsDayBook.Detail);

daPIHeader.Fill (dsDayBook.Header);
daPIDetail.Fill (dsDayBook.Detail);

daRIHeader.Fill (dsDayBook.Header);
daRIDetail.Fill (dsDayBook.Detail);

grid.DataSource = dsDayBook;
grid.DataBind() ;
Why do you need so many data adapters? I'm not trying to be a smart alec,
but I can't imagine the circumstances where so many are needed for the same
dataset.
 
Hi,

DataAdapter is smart enough to use DataTable's primary key.
So the overlapped records will appear only once.
Is this the answer?
 
Back
Top