@
@piranha
hello,
when i'm trying to save changed data from the dataset to datasource(an excel
file)
i get this error
An unhandled exception of type 'System.InvalidOperationException' occurred
in system.data.dll
Additional information: Update requires a valid UpdateCommand when passed
DataRow collection with modified rows.
i use this code (straight from msdn)
Dim DS As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
Dim MyConnection As System.Data.OleDb.OleDbConnection
MyConnection = New System.Data.OleDb.OleDbConnection( _
"provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=C:\myData.XLS; " & _
"Extended Properties=Excel 8.0;")
' Select the data from Sheet1 of the workbook.
MyCommand = New System.Data.OleDb.OleDbDataAdapter( _
"select * from [Sheet1$]", MyConnection)
DS = New System.Data.DataSet()
MyCommand.Fill(DS)
'Here code to change something in dataset
'this i use to update
mycommand.update(ds)
MyConnection.Close()
anybody?
thanx in advance
when i'm trying to save changed data from the dataset to datasource(an excel
file)
i get this error
An unhandled exception of type 'System.InvalidOperationException' occurred
in system.data.dll
Additional information: Update requires a valid UpdateCommand when passed
DataRow collection with modified rows.
i use this code (straight from msdn)
Dim DS As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
Dim MyConnection As System.Data.OleDb.OleDbConnection
MyConnection = New System.Data.OleDb.OleDbConnection( _
"provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=C:\myData.XLS; " & _
"Extended Properties=Excel 8.0;")
' Select the data from Sheet1 of the workbook.
MyCommand = New System.Data.OleDb.OleDbDataAdapter( _
"select * from [Sheet1$]", MyConnection)
DS = New System.Data.DataSet()
MyCommand.Fill(DS)
'Here code to change something in dataset
'this i use to update
mycommand.update(ds)
MyConnection.Close()
anybody?
thanx in advance