Ken
Tue Jun 01 08:22:37 CDT 2004
No, I see his point, and a quick experiment (and a check of the
documentation) indicates there may be an issue here.
1. Client A requests information from the database and retrieves a DataSet.
2. Client B requests the same information and gets the same DataSet.
3. Client A makes some changes, and most notably deletes record '123'.
4. Client A generates a new DataAdpater with the same SELECT, uses Fill() to
update the DataSet, and issues an Update(), which deletes record '123' from
the database (along with any other changes).
5. Client B makes some changes to the DataSet, but does not affect record
'123'.
6. Client B generates a new DataAdapter with the same SELECT and uses Fill()
in preparation for the Update() call -- but the record '123' remains in the
DataSet!
-ken
"William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
news:Oun$qwzREHA.3716@TK2MSFTNGP09.phx.gbl...
> If all of the deletion is being done client side, why pull over two
separate
> instances of the same datatable. Why not just share it and let the
deleting
> function work on the same table as the one in the grid. You can easily
> share a table by making it a static property for instance (shared in
> VB.NET). As soon as the local deletion is done, it will be reflected in
> both places. When you call update from one, it will immediately affect
the
> other.
>
> This has a few benefits
> 1) Solves this problem
> 2) Saves the overhead associated with calling to Select statement and
> filling both of them
> 3) Keeps everything in sync, much easier to code and maintain.
>
> HTH,
>
> Bill
>
> --
>
> W.G. Ryan, eMVP
>
>
http://forums.devbuzz.com/
>
http://www.knowdotnet.com/williamryan.html
>
http://www.msmvps.com/WilliamRyan/
>
http://www.devbuzz.com/content/zinc_personal_media_center_pg1.asp
> "rawCoder" <rawCoder@hotmail.com> wrote in message
> news:uBU%23euvREHA.2408@tk2msftngp13.phx.gbl...
> > Dear All,
> >
> > Question
> > Why DataAdapter.Fill does not refresh the deleted records in the
dataset?
> > If this is by design then how can I refresh the data and get rid of
> removed
> > records without actually refilling the dataset with clear and fill
> > operations?
> >
> > Detailed
> > I have a DataAdapter refering to a table in database. The data is
being
> > shown in a DataGrid. As the data is updated, in the table (from other
> > connection), it is reflected in the grid by a call to the Fill method of
> the
> > DataAdapter. All is well , but if some row is deleted then the call to
> Fill
> > method does not delete the record from its underlying DataSet. I have
come
> > to know that calling clear method is an option but it seems so dirty -
> > clearing all the data and then getting it again.
> >
> > Can someone plz guide Why it is done this way and what is the
resolution.
> >
> > Thank You
> >
> >
>
>