G
Guest
I am having trouble with getting all data back in a dataset from the excel
spread sheet.
Each column is named, however I am finding if the first value under the
named column is not populated the rest of the values are ignored within that
column. I would like to know if this is a bug or a problem with my approach.
The code that is generating the dataset is as follows:
Dim ds As DataSet
Dim myCommand As OleDbDataAdapter
Dim myConnection As OleDbConnection
myConnection = New OleDb.OleDbConnection( _
"provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=" & FileLocationTextBox.Text & _
"; Extended Properties=Excel 8.0;")
Dim row As DataRow
' Select the data from header sheet of the workbook.
myCommand = New OleDbDataAdapter( _
"select * from [" & "Sheet1" & "$]", myConnection)
ds = New DataSet
myCommand.Fill(ds)
DataGrid1.DataSource = ds
spread sheet.
Each column is named, however I am finding if the first value under the
named column is not populated the rest of the values are ignored within that
column. I would like to know if this is a bug or a problem with my approach.
The code that is generating the dataset is as follows:
Dim ds As DataSet
Dim myCommand As OleDbDataAdapter
Dim myConnection As OleDbConnection
myConnection = New OleDb.OleDbConnection( _
"provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=" & FileLocationTextBox.Text & _
"; Extended Properties=Excel 8.0;")
Dim row As DataRow
' Select the data from header sheet of the workbook.
myCommand = New OleDbDataAdapter( _
"select * from [" & "Sheet1" & "$]", myConnection)
ds = New DataSet
myCommand.Fill(ds)
DataGrid1.DataSource = ds