Also
DataTable.GetChanges method
--
Ori Millo
Solutions Consultant
SEA Software Ever After
http://www.s-e-a.com.au
"Fred" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> Hi Peter,
>
> You could create one BindingManagerBase for each table and hook up the
> events CurrentChanged:
>
> BindingManagerBase bm = BindingContext[MyDataSet, "Table1"];
> bm.PositionChanged += new System.EventHandler(this.Table1PositionChanged);
>
> bm.CurrentChanged += new System.EventHandler(this.Table1DataChanged);
>
> Fred
>
> "PeterZ" <_(E-Mail Removed)> wrote in message
> news:40abffd0$0$3037$(E-Mail Removed)...
> > Hi,
> >
> > I have win forms project, a single dataset named "dsAllTables" holding 4
> > tables. I have a seperate dataAdapter for each table named "daTable_#".
> >
> > I know I can detect if the dataset as a whole has changes, but how do I
> > detect which specific table in the dataset has changes?
> >
> >
> > This is something I want to do, obviously it won't compile becase
there's
> no
> > HasChanges() method on a table:
> > ------------------------------------------------------------------
> >
> > private void btnSave_Click(object sender, System.EventArgs e)
> > {
> > this.BindingContext[dsAllTables, "TABLE_1"].EndCurrentEdit();
> > this.BindingContext[dsAllTables, "TABLE_2"].EndCurrentEdit();
> > this.BindingContext[dsAllTables, "TABLE_3"].EndCurrentEdit();
> > this.BindingContext[dsAllTables, "TABLE_4"].EndCurrentEdit();
> >
> > try
> > {
> > if (dsAllTables.Tables["TABLE_1"].HasChanges()) file://<-- how do I
achieve
> > this?
> > this.daTable_1.Update(this.dsAllTables.Tables["TABLE_1"]);
> > if (dsAllTables.Tables["TABLE_2"].HasChanges())
> > this.daTable_2.Update(this.dsAllTables.Tables["TABLE_2"]);
> > if (dsAllTables.Tables["TABLE_3"].HasChanges())
> > this.daTable_3.Update(this.dsAllTables.Tables["TABLE_3"]);
> > if (dsAllTables.Tables["TABLE_4"].HasChanges())
> > this.daTable_4.Update(this.dsAllTables.Tables["TABLE_4"]);
> >
> > this.dsAllTables.AcceptChanges();
> > MessageBox.Show("All changes saved");
> > }
> > catch (OleDbException ex)
> > {
> > MessageBox.Show(ex.Message, "Saving changes failed.");
> > }
> > }
> >
> > ------------------------------------------------------------------
> >
> > Appreciate any ideas!
> >
> > Cheers,
> > PeterZ
> >
> >
>
>