c# - How to get list of columns from CSV file using OleDb? -


i can list of columns excel file this:

columns = connection.getoledbschematable(oledbschemaguid.columns, new string[] { null, null, tablename, null }); 

i'd same csv file i'm not sure parameters required. connection string csv file is:

"provider=microsoft.ace.oledb.12.0; data source={0}; extended properties='text; fmt=delimited(,); readonly={1}; hdr={2}'".formatstring(directory, readonly, (firstlineiscolumnheaders ? "yes" : "no")) 

which turns out (in case) like:

provider=microsoft.ace.oledb.12.0; data source=c:\windows\temp\sadf83.tmp; extended properties='text; fmt=delimited(,); readonly=true; hdr=yes' 

but when try getoledbschematable, command returns okay gives me empty datatable; same true when try getschema("columns").


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -