I have an utility, that reads a CSV files into ADO.Net , modifies it and Saves as another .CSV file.
Unfortunately Microsoft.Jet.OLEDB provider corrupts some string column, incorrectly interpreting them as decimals.
Thanks to the article
I was able to specify schemaIni before reading the file using the function
public static void SaveSchemaIni(string path, string schemaIniContent)
{
FileInfo fileinfo = new FileInfo(path);
string dirPath =fileinfo.DirectoryName;
string schemaIniPath = dirPath + "\\schema.ini";
string sFileNameInIni=schemaIniContent.LeftBefore("]");
string newFileName = ("[" + fileinfo.Name + "]");// +Environment.NewLine
if(!String.IsNullOrEmpty(sFileNameInIni))
{
schemaIniContent=schemaIniContent.RightAfter("]");
}
schemaIniContent = newFileName + schemaIniContent;
StreamHelper.SaveStringToFile(schemaIniContent, schemaIniPath);
}