Microsoft.Jet.OLEDB.4.0 ado .net

Microsoft.Jet.OLEDB.4.0 ado .net

Post by amFy » Sun, 11 Sep 2005 06:35:03


I am reading an excel sheet into a datareader or dataset and would like all
the columns be system.string. I'm using the following connect string:
Private xlPNSCon1 As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\My Documents\some.xls;" & _
'"Extended Properties=""Excel 8.0; HDR=YES; MaxScanRows=0; IMEX=1"""

Is there any option to make ado read the columns as strings?
 
 
 

Microsoft.Jet.OLEDB.4.0 ado .net

Post by amFy » Mon, 12 Sep 2005 10:27:03

I'll answer my own question:
Set HDR=NO and MaxScanRows=1

It will read just the headings to detrmine data tpyes. The headers are text
fields.