CsvReader.Fill method question

Mar 15, 2012 at 1:53 PM

Hi, I'm trying to use the CSVReader.Fill method to populate a dataset.  All of my records are in the datarecordsasstrings property.

Can anyone point me in the right direction on how to get this working?  I can do it manually but I just wanted to know if there's a automated way.

Thanks

Paul.

Coordinator
Mar 15, 2012 at 4:26 PM

Hi Paul,

The API documentation includes an example:

using (CsvReader reader = new CsvReader(@"C:\data.csv")) {
    reader.ReadHeaderRecord();
    DataSet dataSet = new DataSet();
    reader.Fill(dataSet, "csv-data");
}

If this doesn't help, can you provide more details on what you're having trouble with?

Best,
Kent