Hi all,
Has anyone come across this or could explain this? I cant even try to explain it so I will attach my excel file and a snippet code so if any of you out there wants to be really challenged, you can follow along with my explanation.
I am reading in my excel file into a dataset using the JET Engine Extended Property. It seems that it successfully tries to read up to the Row 19. At that point, the return value of the third column appeared to be "NULL" even though there is a value to be read in the actual excel file. If you look closely at my excel file, this is where this is the first instance where this columns value begins with the value none other than ZERO. It also happens again at Row 31 since its vaule again starts with none other than ZERO.
My Sample Code is as:
Dim DS As System.Data.Dataset
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
Dim DS As System.Data.OleDb.OleDbConnection
My Connection = New System,Data.OleDb.OleDbConnection( _
"provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=C:\ReadMeExcel.xls; " & _
"Extended Properties=Excel 8.0;")
MyCommand = New System.Data.OleDb.OleDbDataAdpater( _
"Select * from [Field Reps$]",MyConnection)
DS = New System.Data.DataSet()
MyCommand.Fill(DS)
MyConnection.Close()
And I just loop through the DataSet using Console.WriteLine to scan the data to see if I am getting the values that I am expecting to.What is going on??
Has anyone come across this or could explain this? I cant even try to explain it so I will attach my excel file and a snippet code so if any of you out there wants to be really challenged, you can follow along with my explanation.
I am reading in my excel file into a dataset using the JET Engine Extended Property. It seems that it successfully tries to read up to the Row 19. At that point, the return value of the third column appeared to be "NULL" even though there is a value to be read in the actual excel file. If you look closely at my excel file, this is where this is the first instance where this columns value begins with the value none other than ZERO. It also happens again at Row 31 since its vaule again starts with none other than ZERO.
My Sample Code is as:
Dim DS As System.Data.Dataset
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
Dim DS As System.Data.OleDb.OleDbConnection
My Connection = New System,Data.OleDb.OleDbConnection( _
"provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=C:\ReadMeExcel.xls; " & _
"Extended Properties=Excel 8.0;")
MyCommand = New System.Data.OleDb.OleDbDataAdpater( _
"Select * from [Field Reps$]",MyConnection)
DS = New System.Data.DataSet()
MyCommand.Fill(DS)
MyConnection.Close()
And I just loop through the DataSet using Console.WriteLine to scan the data to see if I am getting the values that I am expecting to.What is going on??
Attachments
Last edited by a moderator: