LINQ select from SQL Server CE: Specified Cast is not valid?

It looks like the mapping between your class and the table has a property mapped to a database field with an incompatible type, e.g. You have an int property mapped to an nvarchar db field.

Hhhhhhmmmmmm this will be annoying to look for, table I'm looking at has just over 100 Columns. – Gazlar Nov 9 at 13:06.

Maybe one of the field definitions doesn't match the field in the database.

I. E if it was mapped wrong and I tried putting String into Int field – Gazlar Nov 9 at 13:07 Did you fill the database with the same dataclasses or did you fill it with a different tool? – Fischermaen Nov 9 at 13:38 The same.

The data was from a csv file. As a test I just removed all the data from the csv file except the first line/row. I then wiped all the data from the SQLCE database and refilled it with just that one row.

Now when I run my code I don't get a problem. I'm guessing the problem is more to do with filling the database. – Gazlar Nov 9 at 13:46 It seems that in one of the fields is a value not expected by your data class.

You inserted the data with an import from csv, don't you? So there still can be a mismatch between your data class and the data in the table. Compare the fields declared in the data class with the fields in your database.

– Fischermaen Nov 9 at 13:49 I take that back. Closed the program, went back into to run my code and the problem has returned! – Gazlar Nov 9 at 13:53.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions