HighTechTalks DotNet Forums  

can't get database Update to work

Dotnet Data Tools microsoft.public.dotnet.datatools


Discuss can't get database Update to work in the Dotnet Data Tools forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
B
 
Posts: n/a

Default can't get database Update to work - 06-13-2005 , 02:43 PM






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!


Reply With Quote
  #2  
Old   
CT
 
Posts: n/a

Default Re: can't get database Update to work - 06-15-2005 , 02:06 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

"B" <B (AT) discussions (DOT) microsoft.com> wrote

Quote:
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!




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.