Last post Mar 28, 2007 03:57 AM by KBrocksi_SEC
Feb 11, 2004 03:36 PM|hotblue|LINK
Jan 16, 2007 10:48 AM|Fyzbo|LINK
I was searching for a solution like this one. Unfortunately I found an error in this solution. If you give it a csv missing a column in one row it messes up. i.e
It will produce a datatable of:
Jan 23, 2007 11:24 PM|CSharpSean|LINK
Mar 07, 2007 08:44 PM|scorpion4000|LINK
you can also read an csv-table with ado.net or odbc.
Mar 28, 2007 03:53 AM|KBrocksi_SEC|LINK
in my mind the easiest way is to use the -of course free- "FileHelpers Library" from
Marcos Meli. This is an automatic file import/export framework. This library is an easy to use .NET library to read/write strong typed data from files with fixed length or delimited records (CSV). Also has support to import/export
data from different data storages (Excel, Acces, SqlServer).
FileHelpers Home Page at SourceForge
FileHelpers Discussions Forums
The main idea is pretty simple:
You can strong type your flat file (fixed or delimited) simply describing a class that maps to each record of the file and work with your file like a strong typed .NET array.
Mar 28, 2007 03:57 AM|KBrocksi_SEC|LINK