DataTable
DataTable copied to clipboard
[DataAccess.AssertException] = {"Row 1 does not have the expected number of values (0)"}
This exception occurs for line: var table = DataTable.New.FromEnumerable(Data); where Data is not empty List of dynamic
Can you give me a specific expression for Data? I can make that into a test case and fix.
There is no any specific. I suppose the simplest example is:
var Data = new List<dynamic>();
Data.Add(new{1});
I used it as
Data = DataTable.New.ReadCsv("data.csv").RowsAs<dynamic>().ToList();
Data.Add(new
{data1, data2, ...});
DataTable.New.FromEnumerable(Data).SaveCSV(@".\data.csv");
RowsAs<T> requires T be strongly typed so that it can infer the columns. It can't do that from dynamic. So this may be by-design, although we could have a better error message.