How can I load a CSV file into a System.Data.DataTable, creating the datatable based on the CSV file?
System.Data.DataTable
Does the regular ADO.net functionality allow this?
With Cinchoo ETL - an open source library, you can easily convert CSV file to DataTable with few lines of code.
using (var p = new ChoCSVReader(** YOUR CSV FILE **) .WithFirstLineHeader() ) { var dt = p.AsDataTable(); }
For more information, please visit codeproject article.
Hope it helps.