T
TheOne
Hi I am trying to open or to fill in to dataset sample excel file. Got it
working couple days ago, but it is giving me error now. It is same error on
2 different machines. Please help.
Code......
Dim sList, strConnToExcel As String
Dim connectionObj As New OleDbConnection
Dim oCmd As New OleDbDataAdapter
Dim oDS As New DataSet
'OpenFileDialog1.ShowDialog()
strConnToExcel = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\TEST2.XLS;Extended Properties=Excel 8.0; HDR=NO;"
sList = "test"
connectionObj.ConnectionString = strConnToExcel
oCmd = New OleDb.OleDbDataAdapter("SELECT * FROM [" + sList + "$]",
connectionObj)
Try
oCmd.Fill(oDS)
Catch ex As Exception
End Try
Thanks,
Sinisa
working couple days ago, but it is giving me error now. It is same error on
2 different machines. Please help.
Code......
Dim sList, strConnToExcel As String
Dim connectionObj As New OleDbConnection
Dim oCmd As New OleDbDataAdapter
Dim oDS As New DataSet
'OpenFileDialog1.ShowDialog()
strConnToExcel = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\TEST2.XLS;Extended Properties=Excel 8.0; HDR=NO;"
sList = "test"
connectionObj.ConnectionString = strConnToExcel
oCmd = New OleDb.OleDbDataAdapter("SELECT * FROM [" + sList + "$]",
connectionObj)
Try
oCmd.Fill(oDS)
Catch ex As Exception
End Try
Thanks,
Sinisa