Groups | Blog | Home
all groups > dotnet datatools > june 2005 >

dotnet datatools : can't get database Update to work


B
6/13/2005 11:43:04 AM
Hi,

I'm unable to get a dataset to update the database properly on a call to
"update". I have a simple form with a bunch of text fields bound to fields in
a table called "settings" . It loads and fills correctly, and when I make
edits to the bound text fields the changes are reflected immediately in the
dataset.

However, whenever I called the Update method on the data adapter. nothing
happens! The Update SQL looks OK (it's basically UPDATE settings SET col1 =
?, ...."; it it correct that the parameter values are bound dynamically on
the Update call?

Manually selecting values out of the dataset does reflect edits to the text
fields, but running the Update command does NOT update the database. So, if
text field has a value "joe" and is bound to a db field "name" via a dataset,
the dataset has the correct value, but the database itself is not updating.

However, if I manually create a new Command object for updating the database
with a custom SQL statement and have it bind to the data adapter as the
update command and then call Update, it does work...but this is a huge pain
since the whole point of using controls bound to database fields is to not
have to do this.

What am I doing wrong? It would be really convenient if the Update method
worked as advertised. :)

thanks!
CT
6/15/2005 8:06:39 AM
You might want to show us the code for the various command properties for
the DataAdapter.

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, AND MSF
http://www.apress.com/book/bookDisplay.html?bID=105

[quoted text, click to view]

AddThis Social Bookmark Button