Click here to Skip to main content
14,301,827 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi all visitors

I have a problem with update my data in sql server 2005.
I use like this:
dataadapter.update(bindingsource.datasource)

after than will display an error like this:
Update requires a valid UpdateCommand when passed DataRow collection.

Please help me
Best Regards,
Posted
Updated 10-Mar-12 21:42pm
v2
Comments
ProEnggSoft 11-Mar-12 3:43am
   
Edit: pre tag for VB.NET code and code tags added - PES
Rate this:
Please Sign up or sign in to vote.

Solution 1

Solving a problem is easiest when you have exact error message. You just need to Google for it.

So is your case. See the link - Error - Update requires a valid UpdateCommand when passed DataRow collection[^].

BTW the error message here is pretty self explaining. You haven't defined an UpdateCommand for the BindingSource. To update something against database, an update query is required and you will need to specify one like this - bindingsource.UpdateCommand = "Update Query here";

Hope this helps!
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

take a look there it maybe help you

[^]
   
Rate this:
Please Sign up or sign in to vote.

Solution 3

I have a suggestion.
Please take a look at this article.
General purpose class to fill DataTable(s) from DataBase and to save DataTable(s) to DataBase using reflection[^]

Using this general purpose class you can fill DataTable(s) from database and save DataTable(s) to database easily.

The sample code given in the article is in C#.
You can use the code converter at Telerik.com
http://converter.telerik.com/[^]
to convert the C# code to VB.NET code
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100