Geeks With Blogs

News My Blog has been MOVED to
Michael Freidgeim's OLD Blog My Blog has been MOVED to

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





schemaIniContent = newFileName + schemaIniContent;

StreamHelper.SaveStringToFile(schemaIniContent, schemaIniPath);

LeftBefore and RightAfter are string extensions from My StringHelper class
Posted on Thursday, May 12, 2011 6:46 AM .Net Framework | Back to top

Comments on this post: Prevent Jet.OLEDB provider to converts strings to decimals

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Michael Freidgeim | Powered by: