preserve rowstates of a datatable?

king_jeremy

Member
Joined
Oct 20, 2009
Messages
13
Programming Experience
Beginner
Hi,
how can I send a datatable from a dataset inside a form to a dialogbox back and forth preserving rowStates. By preserving rowStates I mean keeping track of deleted added changed rows etc. Is this possible?
 
Either pass the filled dataset/datatable to the dialog form or declare it as a global object.
 
I'm not doing it I'm asking how can this be done especially with preserving all the rowstates.

There's no magic to it; just pass the same dataset instance around like you would any other variable. Make the constructor take a dataset:

VB.NET:
Class ADialog Inherits Form
  SubNew(ds as MyDataSet)
   tis.theBindingSource.DataSource = ds.TheTable
  End Sub
End Class

Usage:
VB.NET:
  ...
  Dim dlg as New ADialog(myDSInstance)
  dg.ShowDialog()
  'when code gets to here the instance is carrying all the changes made to it on dialog
  'note it is NOT passed byref! byref is nothing to do with this
 
I did as you said and it works just as I want except for a small fact that to access and manage the datatable there is a bindingsource in between. Is there also a way to use it directly as it is like as a datatable for example.
 
Back
Top