>Instead of calling this:
>
>
>private void CommitChanges(DataSet ds)
>{
> foreach (DataTable dt in ds.Tables)
> {
> foreach (DataRow dr in ds.Tables)
> {
> dr.EndEdit();
> }
> }
>}
>
>
>
>why not do this when I create the table:
>
>
>dt.ColumnChanged += new DataColumnChangeEventHandler(dt_ColumnChanged);
>
>
>then in the event do this:
>
>
>void dt_ColumnChanged(object sender, DataColumnChangeEventArgs e){ e.Row.EndEdit();}
>
>
>This would fire each time the user changes a bound item on a form, wouldn't it? If so, them I'm assured that the table's rowstate
>would always show modifed for changed items.
I guess it depends on how you expect the user to behave. If they make a ton of changes and don't save then the event has fired a lot of times to no purpose. If, OTOH, you expect only one or two changes then using the event approach might be more efficient.....