Hi,
So I do actually know how to read excel into VB.NET using the following
approach:
With oConn2
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source="
& FilePath & ";Extended Properties=Excel 8.0;"
.Open()
End With
Worksheet = "Well Data"
strSQL = "SELECT * FROM [" & Worksheet & "$]"
With oCmd2
.Connection = oConn2
.CommandType = CommandType.Text
.CommandText = strSQL
End With
oDA2.SelectCommand = oCmd2
oDA2.Fill(oDS2)
This approach works great except for with the type of excel worksheet I
am dealing with now. This particular worksheet has a column which
contains numbers, dates, strings containing only text and strings
containing numbers and text. The first value it runs across is a
number and from that point on it tries to force everything in the
column to be a number, and if it contains text, then it simply returns
a DBNull value for that cell.
Is there something I can do to force the Data Adaptor to see this
column as simply text and to just leave it alone? Or is there another
approach to reading Excel that I could use?
Thanks!
Joy