Quantcast
Channel: SQL Server Compact & SQLite Toolbox
Viewing all articles
Browse latest Browse all 2796

Commented Unassigned: Exception reading float [11806]

$
0
0
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 **

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()


Viewing all articles
Browse latest Browse all 2796

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>