When does update fire?

deanlee17
deanlee17 used Ask the Experts™
on
Hi Experts,

Ok I have a bound dataset. I have created an update command, if i go into query builder and execute builder then the query runs and I enter a few details and the update works.

But on my form if I edit any data and hit the save icon at the top of the form I get 'Update requires a valid UpdateCommand when passed DataRow collection with modified rows.'

If I make a change on the form and just close it then no data changes in the table.

What am I doing wrong?

Thanks,
Dean
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Use command builder...

See link below:

http://msdn.microsoft.com/en-us/library/tf579hcz.aspx

Author

Commented:
My dataset will soon contain 2 tables so I may need an alternative to your solution?
Most Valuable Expert 2012
Top Expert 2014
Commented:
Two linked tables? Then you would need to generate the update command yourself.

http://blogs.msdn.com/b/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial