Groups | Blog | Home
all groups > dotnet ado.net > july 2007 >

dotnet ado.net : Datatable Update method not updating


Flomo Togba Kwele
7/30/2007 1:08:26 PM
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
--
v-wywang NO[at]SPAM online.microsoft.com
7/31/2007 12:00:00 AM
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.
Earl
8/4/2007 12:34:23 AM
If you don't want to manually dig through the generated code, simply
recreate your command objects for insert and update.

[quoted text, click to view]

Flomo Togba Kwele
8/8/2007 3:45:51 PM
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
--


AddThis Social Bookmark Button