I'm using a DataAdapter to Update and Synchronize with the database.
When I do a Fill on my dataAdapter I get the changed and new records from
the database (changed by other users) into my dataset but not those which
have been deleted at the database.

Is this the way the DataAdapter should work (don't synchronize the deleted
records from the database to the dataset) or is it my fault?

If this is the way the DataAdapter act's what can be done, do get completely
in synch? If I do a clear on my dataset before invoking the Fill method, my
databinding get's lost for a Moment, because the dataset is completely
rebuild.

Thanks.

Re: Getting changes from the database by Miha

Miha
Tue Jan 20 09:10:23 CST 2004


"Limberger Florian" <florian.limberger@aon.at> wrote in message
news:400d433b$0$17706$3b214f66@aconews.univie.ac.at...
>
> I'm using a DataAdapter to Update and Synchronize with the database.
> When I do a Fill on my dataAdapter I get the changed and new records from
> the database (changed by other users) into my dataset but not those which
> have been deleted at the database.
>
> Is this the way the DataAdapter should work (don't synchronize the deleted
> records from the database to the dataset) or is it my fault?

How can retrieve non-existing (deleted) records - deleted rows are, well,
deleted?

> If this is the way the DataAdapter act's what can be done, do get
completely
> in synch? If I do a clear on my dataset before invoking the Fill method,
my
> databinding get's lost for a Moment, because the dataset is completely
> rebuild.

Yes. You might invoke BindingManagerBase.SuspendBinding() method.
However after ResumeBinding the position will be reset.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com



Re: Getting changes from the database by Limberger

Limberger
Tue Jan 20 09:43:35 CST 2004


> > I'm using a DataAdapter to Update and Synchronize with the database.
> > When I do a Fill on my dataAdapter I get the changed and new records
from
> > the database (changed by other users) into my dataset but not those
which
> > have been deleted at the database.
> >
> > Is this the way the DataAdapter should work (don't synchronize the
deleted
> > records from the database to the dataset) or is it my fault?
>
> How can retrieve non-existing (deleted) records - deleted rows are, well,
> deleted?

I meant, that the dataAdapter could delete the row within the
dataset if there is no corresponding one in the database. Just by comparing
the new retrieved dataset with the old one.
But that might be more overhead, than doing a clear and rebuilding.

> > If this is the way the DataAdapter act's what can be done, do get
> completely
> > in synch? If I do a clear on my dataset before invoking the Fill method,
> my
> > databinding get's lost for a Moment, because the dataset is completely
> > rebuild.
>
> Yes. You might invoke BindingManagerBase.SuspendBinding() method.
> However after ResumeBinding the position will be reset.

Well, I could save the old ID and restore the Position (via searching in the
dataset).

thanx
Flo




Re: Getting changes from the database by Miha

Miha
Wed Jan 21 02:58:24 CST 2004

Hi,

"Limberger Florian" <florian.limberger@aon.at> wrote in message
news:400d4c8c$0$13326$3b214f66@aconews.univie.ac.at...
> I meant, that the dataAdapter could delete the row within the
> dataset if there is no corresponding one in the database. Just by
comparing
> the new retrieved dataset with the old one.
> But that might be more overhead, than doing a clear and rebuilding.

Then you should do the following:
Load new data into new dataset.
Compare original and new dataset for deleted rows (those that are present in
original but not in new one).
Delete the deleted rows in original dataset.
Perform an original.Merge(newone).
That should do the trick.


> Well, I could save the old ID and restore the Position (via searching in
the
> dataset).

Sure.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com