I am simply trying to export back to Excell the table i imported into vb and
modified by changing some entries. My code can display the modified table in
my datagridview2, but always starts debugger when it gets to the
mycommand.update line. es and ds are both of the type dataset. Can anyone
tell me what I am coding incorrectly? thanks.
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnUpdate.Click
ES = New System.Data.DataSet
ES = DS
DataGridView2.DataSource = ES.Tables(0)
MyConnection = New
System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; " &
"data source=D:\CoalBed\welllisttest2.xls; " & "Extended Properties=Excel
8.0;")
MyCommand = New System.Data.OleDb.OleDbDataAdapter("insert * into
[Sheet1$]", MyConnection)
MyCommand.Update(ES)
End Sub
--
Kimark
System Architect
|