private static void FillColumnValues(DataTable table, XlsxReader.XlsxReader.Sheet sheet) { foreach (var firstRow in sheet.Rows.First()) { table.Columns.Add(firstRow.Key, typeof(string)); } }
private static void FillRowValues(DataTable table, XlsxReader.XlsxReader.Sheet sheet) { foreach (var row in sheet.Rows) { var rowValues = new List <string>(); foreach (var kv in row) { rowValues.Add(kv.Value); } table.Rows.Add(rowValues.ToArray <object>()); } }