I'm using "Add LINQ to SQL Datacontext".
When querying one table I get an InvalidCastException.
var test = from row in db.Batch select row;
foreach (var x in test)
Console.WriteLine(x);
It appears that a column of type float is the problem:
I can get data from other columns:
var test = from row in db.Batch select row.ColumnA; //(not float)
but when I query the column of type float the exception is thrown
var test = from row in db.Batch select row.ColumnB; //(float)
Comments: ** Comment from web user: peterad **
When querying one table I get an InvalidCastException.
var test = from row in db.Batch select row;
foreach (var x in test)
Console.WriteLine(x);
It appears that a column of type float is the problem:
I can get data from other columns:
var test = from row in db.Batch select row.ColumnA; //(not float)
but when I query the column of type float the exception is thrown
var test = from row in db.Batch select row.ColumnB; //(float)
Comments: ** Comment from web user: peterad **
This is the stack trace of the InvalidCastException.
vid System.Data.SqlServerCe.SqlCeDataReader.GetDouble(Int32 ordinal)
vid Read_Double(ObjectMaterializer`1 )
vid System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReader`2.MoveNext()