MyCommand1 = New OleDbDataAdapter("select * from [MyExcel$A13:x150]", MyConnection) DataSet1 = New System.Data.DataSet() MyCommand1.Fill(DataSet) 'This displays the data to the GUI but does not save it to the DB table that we ultimately want it saved to DataGridView1.DataSource = DataSet1.Tables(0).DefaultView
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Try oledbCmdBuilder = New OleDbCommandBuilder(oledbAdapter) changes = DataSet1.GetChanges() If changes IsNot Nothing Then oledbAdapter.Update(DataSet1.Tables(0)) End If DataSet.AcceptChanges() MsgBox("Save changes") Catch ex As Exception MsgBox(ex.ToString) End Try End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)