Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / August 2007

Tip: Looking for answers? Try searching our database.

Problem with data table manipulation prior to update

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
B. Chernick - 27 Aug 2007 19:50 GMT
I'm passing a data table to a form.  This table is then bound to a binding
source which is in turn bound to a datagridview so that only a subset of the
table is ever displayed (filters by key).  This form is your basic dialog
with OK/Cancel buttons.

For reasons too complicated to explain, what I need to do is be able to pass
this same data table multiple times to this same form, make multiple
adds/mods to the table (for a given key) and then either accept or reject
each batch of adds/mods.  All of this is to take place without updates to the
database.  The update is supposed to happen only once much later on.

When I simply try to loop through the datatable and removing unwanted new
rows, I get RowNotInTableException errors (This row has been removed from a
table and does not have any data. etc...)

What would be a good approach to this problem?  Anything I'm missing?  (This
feels like deja vu.)
B. Chernick - 27 Aug 2007 20:40 GMT
OK.  Cancel this.  I'm going to answer my own question (I hope)

After passing the datatable to the form, I copied it, so that all
manipulation is with the copy.  If the user hits OK, the duplicate table is
copied back the original.

(Of course, I'm assuming a relatively small table, hopefully no more than a
few hundred records.  Seems to work, so far....)

> I'm passing a data table to a form.  This table is then bound to a binding
> source which is in turn bound to a datagridview so that only a subset of the
[quoted text clipped - 13 lines]
> What would be a good approach to this problem?  Anything I'm missing?  (This
> feels like deja vu.)
Cor Ligthert[MVP] - 28 Aug 2007 04:55 GMT
B.

This is normal behaviour, delete (not remove that does not update the
database) them upwards.

Cor

> I'm passing a data table to a form.  This table is then bound to a binding
> source which is in turn bound to a datagridview so that only a subset of
[quoted text clipped - 18 lines]
> (This
> feels like deja vu.)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.