Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataAccess.AssertException] = {"Row 1 does not have the expected number of values (0)"} #32

Open
arteny opened this issue Apr 27, 2014 · 3 comments

Comments

@arteny
Copy link

arteny commented Apr 27, 2014

This exception occurs for line:
var table = DataTable.New.FromEnumerable(Data);
where Data is not empty List of dynamic

@MikeStall
Copy link
Owner

Can you give me a specific expression for Data? I can make that into a test case and fix.

@arteny
Copy link
Author

arteny commented Apr 27, 2014

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");

@MikeStall
Copy link
Owner

RowsAs 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants