I need a CSVParser class file A Class File which parses csv and returns a dataSet as a result ASP.Net
wow. Jet. Completely forgot about oledb...
Will
2009-01-12 12:40:08
+2
A:
I'm pretty sure that CSVReader (CodeProject) can read to DataTable
.
DataTable table = new DataTable();
// set up schema... (Columns.Add)
using(TextReader text = File.OpenText(path))
using(CsvReader csv = new CsvReader(text, hasHeaders)) {
table.Load(csv);
}
Note that manually setting up the schema is optional; if you don't, I believe it assumes that everything is string
.
Marc Gravell
2009-01-12 12:40:03
A:
I've had luck with this parser. It will return results to a DataSet.
Another tool you might want to check out is FileHelpers. I see there's a tag for this resource here on SO.
Jay Riggs
2009-01-12 18:00:00