Gonzo TechNet

ADO.NET text file ConnectionString Extended Properties

A few hints before we start,

Example ADO.NET/VB.NET ConnectionString for Text files with extended properities:
cnStr="Provider=Microsoft.Jet.OLEDB.4.0;" & _
	"Data Source=" & sPath + ";" & _
	"Extended Properties='text;HDR=YES;FMT=CSVDelimited;'; "

cnStr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDir;Extended Properties='text;HDR=YES;FMT=CSVDelimited;'; "

As an alternative, you can specify a "schema.ini" file. But, that is waaaaaaaaay beyond what I'm trying to accomplish here... (Good luck)

Property NameDescriptionValue(s)
Provider Name of provider. Since ADO.NET doesn't have one inherantly, use OleDB. Microsoft.Jet.OLEDB.4.0
FMT File is "formatted" using a specific style or delimiter Delimited
Each field of the file is "delimited". The default is a comma (,)
Each field of the file is "delimited" by the value within the parentheses. Example of using a pipe charater: Delimited(|).
Each record/row in he file is formatted using QUOTED/Comma separated values.
Ex: "Bob","Johnson","123 anystreet"
Each field in each record of the file is separated by a TAB character.
Ex: bobJohnson123 AnyStreetMy TownNew York
HDR The first row in the file is the "Header". It contains the names of the fields/columns YES It DOES have a header row
NO It does NOT have a header row
Home | TechNet | ADO.Net | DOS | ASP.NET | IIS | VB.NET | VIM (vi) | Windows | XHtml
MS-SQL | T-SQL | SSIS | Oracle