Datatable updating pbs.

  • Thread starter Thread starter fh
  • Start date Start date
F

fh

Hello,

I modify one row of a datatable
with this code

DataRow drCurrent = _dsDowntime.Tables["PPE_DOWNTIME"].Rows[numRow];
drCurrent.BeginEdit();
drCurrent["Automatic"]=txbCAuto.Text;
drCurrent["DowntimeStart"]=txbbeg.Text;
drCurrent["DowntimeEnd"]=txbEnd.Text;
drCurrent.EndEdit();

but i can't see any change when I reload the data
even if i request for their current state

Franck
 
Franck,

Calling BeginEdit and EndEdit doesn't commit the changes to the
database. The DataSet is disconnected, meaning that the data you have in
the DataSet is not connected to the database it came from in any way.

In order to update the records, you have to pass the dataset to a
DataAdapter (preferably, the one you used to select the data) through the
Update method.

Hope this helps.
 
thanks for your answer
but when I wrote, reload the data,
I meant from the dataset modified (apparently not...)
 
fh,

If you change a value on a column in a row, then the row state of the
row should change automatically.

Are you filtering on the rowstate perhaps and you don't know it?
 
Nicholas said:
fh,

If you change a value on a column in a row, then the row state of the
row should change automatically.

Are you filtering on the rowstate perhaps and you don't know it?
thank you for your answer,
in fact no
to view my data i use:

txbDate.Text=
drLigneCourante["ValidationDate",DataRowVersion.Current].ToString();

so the state is current
 
Back
Top