Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update database via Tableadapter

Status
Not open for further replies.

VB4Life

Programmer
Nov 8, 2008
50
US
Hi all I am new to DataGridViews, wanting to update the database after a cell is edited in the DGV, how is this accomplished? I am using a tableAdapter and a strong typed dataset? VB.Net2008 Express/SqlServerExpress2008.
 
I'm not sure exactly. There are probably tutorials on MSDN.Microsoft.com. TableAdapters are wizard-created objects in VB.Net to help you with your database access. I've never used them other than in testing. I prefer to use DataSets, Commands and DataAdapters. If you want to write your own code instead of using the wizard, your DataAdapter will need an .InsertCommand, .UpdateCommand and .DeleteCommand.

Here's an article which explains it in greater detail.
 
That is probably the way to go, that I can do, thanks!
 
Actually if you call the TableAdapter.Update in the dvg_CellEndEdit Event it will update the row info to the database. I had some editing to do in the Update statement it is working now. I just wanted it to do this automatically instead of having a button, you just in case they forget and they will. LOL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top