Datatable Update method not updating

F

Flomo Togba Kwele

I have a dataset containing a datatable. Everything was working OK. Then I changed the definition
of one of the columns from not null to nullable. Now when I update the adapter, the change is not
being written to the DB.

Just before the update, I looked at the data in the datatable by walking through the datarows, and
it contains the expected value for the row and column I'm interested in. The very next statement is
the Update.

What could be causing this? What tools can I use to diagnose this further?

Thanks, Flomo
--
 
W

WenYuan Wang [MSFT]

Hello Flomo,

In general, ADO.net will check if the original value exists in the
underlying database, and then update the current value to database.

What does the update SQL statement looks like in your application?
Additionally, have you check the original version value?

I'd like to recommend SQL Profile tool to diagnose such issue, if
underlying database is SQL server.
1, open SQL Profile
2, create a new trace
3, start trace.
4, reproduce the issue (Modify the dataset and update the dataset to
underlying database)
5, stop the trace
6, save the trace log as .trc file

Would you please post the trace log in the newsgroup? Thus, we will perform
further analyze.

Have a great day,
Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
E

Earl

If you don't want to manually dig through the generated code, simply
recreate your command objects for insert and update.
 
F

Flomo Togba Kwele

I gave up on this and reverted to an older version which worked.

I am sorry I didn't have time to try the suggestions, but I do thank you for them.

Flomo
--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top