private void FeedCsv() { using (CsvToDataTable csvToDataTable = new CsvToDataTable(Job)) { int myColumnCount = 0; List <string> csvRows = new List <string>(); List <string> warnings = new List <string>(); Job.InputData = csvToDataTable.ParseData(ref csvRows, ref warnings, ref myColumnCount); Job.CsvRows.AddRange(csvRows); Job.Warnings.AddRange(warnings); if ((Job.DataSource.IsFirstRowHeader) && (Job.CsvRows.Count > 0)) { Job.BadDataInCsvFormat.Add(Job.CsvRows[0]); //storing header information } Job.ColumnCount = myColumnCount; } }
/// <summary> /// Converts xml file into data table /// </summary> /// <param name="csvRows">List of string csv rows</param> /// <param name="emptyRowWarnings">List of warnings</param> /// <param name="columnCount">Total column count</param> /// <returns></returns> public DataTable Parse(ref List <string> csvRows, ref List <string> emptyRowWarnings, ref int columnCount) { CsvToDataTable csvToDataTable = new CsvToDataTable(Job); return(csvToDataTable.ParseData(ref csvRows, ref emptyRowWarnings, ref columnCount)); }