Hi all, I am reading data from an excel spreadsheet. The column data which i am reading from my spreadsheet reads as follows:
integer
integer
integer
var char
integer
integer
integer
var char
var char
null
integer
etc.....
As you can see it contains no specific data types, but just a selection of random ones.
My problem is that when i read this into my vb code, the cells containing var char values get returned as Null values. I have seen bits by searching google but nothing that really helps me solve this problem. My understanding is that the connection string needs to contain some additional extended properties in order to prevent the dbconnection from assuming the correct data type for the column.
My Code:
Dim conn as new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & pathOfSpreadSheet & ";Extended Properties=Excel 8.0")
Dim cmd As New OleDbDataAdapter("SELECT [rowX] FROM [Sheet1$]", conn)
'Fill my dataset
cmd.Fill(myDataSet)
Any help would be greatly appreciated.