views:

533

answers:

3

I need a CSVParser class file A Class File which parses csv and returns a dataSet as a result ASP.Net

+1  A: 

Simple google gives plenty of results.

Steven Robbins
wow. Jet. Completely forgot about oledb...
Will
+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
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