save changes to datatable back to database

  • Thread starter Thread starter cj
  • Start date Start date
C

cj

Dim myExcelConnection As New
System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=" & filename & "; Extended Properties=""Excel 8.0""")
Dim myExcelSqlCommand As String = "SELECT * FROM [all ANIs$]"
Dim myExcelAdapter = New
System.Data.OleDb.OleDbDataAdapter(myExcelSqlCommand, myExcelConnection)
myExcelAdapter.fill(myExcelDt)
DataGridView1.DataSource = myExcelDt

Now assuming I've made changes to myExcelDt via the DataGrid how do I
save these back to the database?
 
Hi Cor,

I like your links. The second seems interesting but it didn't work.
Anyway I'm trying to keep this learning generic as what I learn here I
also need to apply to other Oledb databases--mostly Visual Fox Pro
tables. We do import a lot of CSV files into VFP tables and export a
lot of VFP tables to csv and VFP supports exporting straight to Excel as
well.

I believe now that the connection to excel is not going to be a good
test for using VFP tables so I'll probably create a few test tables to
play with.
 
Back
Top