I'm using the Microsoft OLEDB JET driver to read Excel CSV files (comma delimited)
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=xxx; Extended Properties='text;HDR=Yes;IMEX=0'"
I use code like below to load the input file into a datatable, this works fine except one problem - if the input field has double quotes around it, the double quotes were gone when I load it into a DataTable after openning it using the oledb driver.
some of the input fileds has double quotes around the field because there are special characters like a comma, I need to output the same file format (basically splitting the same file into multiple files based on value of a specific field) after processing but keep those double quotes. how do I keep the double quotes in the input file??
OleDbCommand cmd = new OleDbCommand(string.Format("SELECT * FROM {0}", configSection.InputFile), cn);
OleDbDataAdapter adp = new OleDbDataAdapter(cmd);
DataTable dt = new DataTable();
adp.Fill(dt);