updating datatable 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

thanks
Franck
 
What do you mean when you say "i can't see any change when I reload the
data"?

When you reload the data, are you requerying the database? If so, have you
submitted this row back to the db with DataAdapter.Update or called
ExecuteNonQuery? If not, then the changes aren't persisted back to the db
so when you requery the db, they won't be there since they've never been
saved.

Or do you mean that after the EndEdit() line, if you call HasChanges() that
it indicates false? If you could elaborate about what's happening and how
you are telling that the changes aren't present, I can be of more help.

HTH,

Bill
 
W.G. Ryan MVP said:
What do you mean when you say "i can't see any change when I reload the
data"?

When you reload the data, are you requerying the database? If so, have you
submitted this row back to the db with DataAdapter.Update or called
ExecuteNonQuery? If not, then the changes aren't persisted back to the db
so when you requery the db, they won't be there since they've never been
saved. no

Or do you mean that after the EndEdit() line, if you call HasChanges() that
it indicates false? If you could elaborate about what's happening and how
you are telling that the changes aren't present, I can be of more help.
thank you for you answer,

yes this is what I tried to explain

and I just checked up with the HasChanges()method
and
it returned false...

HTH,

Bill
fh said:
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

thanks
Franck
 
Are you saying No to the question about Requerying the db or the question
about submitting the update - or both?

If after the endedit line the dataset doesn't have any changes, something
else is the problem b/c if you're changing the values, then HasChanges
should be true.
fh said:
W.G. Ryan MVP said:
What do you mean when you say "i can't see any change when I reload the
data"?

When you reload the data, are you requerying the database? If so, have
you submitted this row back to the db with DataAdapter.Update or called
ExecuteNonQuery? If not, then the changes aren't persisted back to the
db so when you requery the db, they won't be there since they've never
been saved. no

Or do you mean that after the EndEdit() line, if you call HasChanges()
that it indicates false? If you could elaborate about what's happening
and how you are telling that the changes aren't present, I can be of more
help.
thank you for you answer,

yes this is what I tried to explain

and I just checked up with the HasChanges()method
and
it returned false...

HTH,

Bill
fh said:
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

thanks
Franck
 
Back
Top