L
Lisa
Hi!!
Can any one help me get this info -
Update individual cells in Excel using ADO.NET
I keep getting error in the update statement.
Thanks for any help in advance!!
Here is my code -
Dim connString As String
connString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=ExcelData1.xls;" & _
"Extended Properties=""Excel 8.0;HDR=YES"""
objconnection = New OleDbConnection(connString)
objconnection.Open() 'open the connection
Dim cmd1 As New OleDbCommand
cmd1.Connection = objConnection
cmd1.CommandText = "INSERT INTO EmployeeData1 (Id, Name,
BirthDate) values ('AAA12', 'Andrew21', '12/4/1955')"
cmd1.ExecuteNonQuery()
cmd1.CommandText = "UPDATE [EmployeeData1] SET id = 'ad',
A2 = 'Cell F3'" ', F2 = 'Cell G3' where F1<>'1'"
cmd1.ExecuteNonQuery()
objConnection.Close()
Can any one help me get this info -
Update individual cells in Excel using ADO.NET
I keep getting error in the update statement.
Thanks for any help in advance!!
Here is my code -
Dim connString As String
connString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=ExcelData1.xls;" & _
"Extended Properties=""Excel 8.0;HDR=YES"""
objconnection = New OleDbConnection(connString)
objconnection.Open() 'open the connection
Dim cmd1 As New OleDbCommand
cmd1.Connection = objConnection
cmd1.CommandText = "INSERT INTO EmployeeData1 (Id, Name,
BirthDate) values ('AAA12', 'Andrew21', '12/4/1955')"
cmd1.ExecuteNonQuery()
cmd1.CommandText = "UPDATE [EmployeeData1] SET id = 'ad',
A2 = 'Cell F3'" ', F2 = 'Cell G3' where F1<>'1'"
cmd1.ExecuteNonQuery()
objConnection.Close()