LinqToExcel
LinqToExcel copied to clipboard
If the first row was not string, and first value was double, then any string later will be null
See this stackoverflow case https://stackoverflow.com/a/28862382/4516125
I have the same problem. Suggestion: When defining the mapping you could also specify a type to which the mapping should "convert" or extend the transformations in that way.
Can you show me an example? Mapping does not work for me.
My previous comment is not relevant, becasue OleDbDataAdapter "decides" what data types are the columns going to be. Based on my research you can't define a columns's data type when reading from excel (I have downloaded the solution in debugged it and seen how the dataadapter works). Normally it analyses the first 8 rows and defines the data type based on the pattern from this rows. You could change the number of how many rows should he read in the registry but I do not garanty that will work.
In my case there where 3 rows empty, then one had a number and the 5 where empty and the one had a string. So the adapter defined the column as a number which was wrong. The only thing that seem to work for me was to define the cell/column type from "general" to "text", then all the values where read as string.
Thank you very much, this conversion from "general" to "text" worked well with me
Is any other solution for this? that done by some setting in code.