' This is how I retrieve my datasource Sub retrieveDGV() MyCommand = New OleDbDataAdapter("select * from [ExcelWorksheet$A4:I150]", MyConnection) DataSource = New System.Data.DataSet() MyCommand.Fill(DataSource) DGV.DataSource = DataSource.Tables(0).DefaultView Private Sub btnrefreshDGV_Click(sender As Object, e As EventArgs) Handles btnrefreshDGB.Click refreshDGV() End Sub ' This is how I use the isdirty flag Private Sub DGV_CellEndEdit(sender As Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DGV.CellEndEdit DGVisdirty = True End Sub Sub refreshDGV() If DGBisdirty Then write2DGV() objworkbook.Save() retrievedDGV() End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)