p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Visual Basic 2005 Basics (http://p2p.wrox.com/forumdisplay.php?f=137)
-   -   update dataadapter (http://p2p.wrox.com/showthread.php?t=65795)

karenai February 9th, 2008 10:46 PM

update dataadapter
How do you update a database (access 2003) with values that have been changed in a datagridview?

I use this code to fill a datagridview with data:

Private Sub frmdeliveryreport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim spDataConnection As New OleDb.OleDbConnection
spDataConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="test.mdb"

mysql = "SELECT * FROM tblMain"

Dim spDataAdapter = New OleDb.OleDbDataAdapter(mysql, spDataConnection)
Dim deliveryds As New DataSet
spDataAdapter.Fill(deliveryds, "tblDelivery")

Me.DataGridView.DataSource = deliveryds.Tables("tblDelivery")

End Sub

I want to use a "Save Data" button to update the database with new data. Any ideas what code I'll need?

All times are GMT -4. The time now is 05:29 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.