G
Guest
Hi, I used below code to retrieve data from an Excel file
'Code to open the file here
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='c:\CoopMetrics\test.xls';Extended Properties=Excel 8.0;
'Now using the OledbDataAdapter you can query the excel sheet
Dim myDataset As New DataSe
Dim myData As New OleDbDataAdapter("SELECT * FROM [General Ledger Trial Balanc (2)$]", strConn
myData.TableMappings.Add("Table", "ExcelTest"
myData.Fill(myDataset
The fourth column in this excel spreadsheet has no values for the first 42 records but has value on the 43rd record. When I try to read the value for the fourth column in the 43rd record, it read in a null value though it SHOULD have a value. Why is it this way? How can I fix that
Thanks for info
'Code to open the file here
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='c:\CoopMetrics\test.xls';Extended Properties=Excel 8.0;
'Now using the OledbDataAdapter you can query the excel sheet
Dim myDataset As New DataSe
Dim myData As New OleDbDataAdapter("SELECT * FROM [General Ledger Trial Balanc (2)$]", strConn
myData.TableMappings.Add("Table", "ExcelTest"
myData.Fill(myDataset
The fourth column in this excel spreadsheet has no values for the first 42 records but has value on the 43rd record. When I try to read the value for the fourth column in the 43rd record, it read in a null value though it SHOULD have a value. Why is it this way? How can I fix that
Thanks for info