View Single Post
  #1 (permalink)  
Old February 9th, 2008, 10:46 PM
karenai karenai is offline
Registered User
 
Join Date: Jan 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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?
Reply With Quote