updating database using dataset  
Author Message
zybernau





PostPosted: Visual Basic Language, updating database using dataset Top

how to update the data to database(physical) from datagrid using dataset

please reply with codes and concepts..




Visual Basic16  
 
 
DMan1





PostPosted: Visual Basic Language, updating database using dataset Top

Me.TableAdapter.Update(Me.DataSet.Table)

http://msdn.microsoft.com/vbasic/downloads/code/101samples/#data



 
 
zybernau





PostPosted: Visual Basic Language, updating database using dataset Top

thnks for reply dman

i tried your code , but in vain its doesn't seem to be working

it says "no upload command found" sort of error



 
 
spotty





PostPosted: Visual Basic Language, updating database using dataset Top

I would assume that you checked that the tableadapter actually had SQL Commands for the update / Delete and insert as well as the select method.

When you say it didnt work did it generate and exception / error   Please provide the specific error - not just a sort of.

From the error so far it looks like you havent set up an update SQL Command set

So you can confirm you definately got an update command established for the table adapter.

The best way to check if the update method exists is to open the Dataset Designer by double-clicking on your dataset in the Solution Explorer.

After the designer is open click on the TableAdapter in the designer and then look at the Properties Window.  There is a property called "UpdateCommand". 

If the command was generated then you should be able to expand this property and see what the exact command was that you generated.  If it wasn't generated the property should have a value of "Nothing".

The dataset when generated by default will not auto generate the delete, update and insert methods unless you specifically ask for them and you also need to have a primary key on the table (I think) .   So this would be my first course of action based upon this exception.
 

A bit more detail is likely to get you some assistance - remember we cannot see you machine to know what is happening.   You have to provide us with the details.

No Update command - No Update Database

Once you have the commands in place then the line - with your tableadapter and table should work.

Me.TableAdapter.Update(Me.DataSet.Table)