Re: Datatable updating pb...

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You lneed to call AcceptChanges method on either DataRow or DataTable or
DataSet.

The following is from the MSDN Library topic:

You can confirm edits by calling EndEdit or you can cancel them by calling
CancelEdit. Note that while EndEdit does confirm your edits, the DataSet
does not actually accept the changes until AcceptChanges is called. Note
also that if you call AcceptChanges before you have ended the edit with
EndEdit or CancelEdit, the edit is ended and the Proposed row values are
accepted for both the Current and Original row versions. In the same manner,
calling RejectChanges ends the edit and discards the Current and Proposed
row versions. Calling EndEdit or CancelEdit after calling AcceptChanges or
RejectChanges has no effect because the edit has already ended.


Eliyahu

"fh" <fh@xxxxxx> wrote in message news:de26ko$b97$3@xxxxxxxxxxxxxxxxxxxxx
> thanks for your answer
> but when I wrote, reload the data,
> I meant from the dataset modified (apprently not...)
>
> Eliyahu Goldin wrote:
> > Franck,
> >
> > EndEdit doesn't save data to the database, it just ends the edit
occuring on
> > the row.
> >
> > Eliyahu
> >
> > "fh" <fh@xxxxxx> wrote in message
news:de24o2$ad8$1@xxxxxxxxxxxxxxxxxxxxx
> >
> >>Hello,
> >>
> >>I modifie one row of a datatable
> >>with this code
> >>
> >>DataRow drCurent = _dsDowntime.Tables["PPE_DOWNTIME"].Rows[numRow];
> >>drCurent.BeginEdit();
> >>drCurent["Automatic"]=txbCAuto.Text;
> >>drCurent["DowntimeStart"]=txbbeg.Text;
> >>drCurent["DowntimeEnd"]=txbEnd.Text;
> >>drCurent.EndEdit();
> >>
> >>but i can't see any change when i reload the data
> >>even if i ask for their current state
> >>
> >>Any help please
> >>Franck
> >
> >
> >


.



Relevant Pages

  • Re: Datatable updating pb...
    ... You can confirm edits by calling EndEdit or you can cancel them by calling ... Note that while EndEdit does confirm your edits, ... does not actually accept the changes until AcceptChanges is called. ... EndEdit or CancelEdit, the edit is ended and the Proposed row values are ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Datatable updating pb...
    ... If you check HasChangesbefore AcceptChanges(), ... >> You can confirm edits by calling EndEdit or you can cancel them by ... >> EndEdit or CancelEdit, the edit is ended and the Proposed row values are ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Problems with DataView.RowFilter
    ... Jack, check the value of NeedsStatus in the dattable, it sounds like the ... edit isn't finished. ... > I tried modifying to use a DataRowand foreach loop using a Select ... Do I need to do an AcceptChanges? ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Out of memory exception when manually building a table
    ... So, if the datatable isn't mapped back to a beck end db, Calling Delete ... physically get rid of the rows. ... Another Alternative is to call .AcceptChanges on the ... added around 500K of RAM is allocated and nothing is ever garbage collected. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: DataBinding generates exception ???
    ... work, when you call AcceptChanges, it will end the edit, reset the rowstate ... etc. Make sure that the current edit is finished before calling update b/c ... AcceptChanges, it's trying to add what's already there.. ... "Chris" wrote in message ...
    (microsoft.public.dotnet.languages.csharp)