Page 1 of 1

Bug with nested queries

Posted: Wed 26 May 2010 11:35
by dilbert
After upgrading to the latest version (dotConnect for MySQL 5.80.140) some our queries run into exception.

Please, try the following scenario:

Code: Select all

var list1 = from t1 in DB.Table1
                select new { t1.Id, t1.Column1 };

foreach (var row in list1)
{
    DB.Table2.ToList();
}
If Column1 in first table is nullable (e.g. int?) and the value in database is NULL then the first iteration cycle throws exception 'Specified cast is not valid' after the first iteration. If the nested query is omitted, the query executes correctly.
These queries worked properly in previous versions.

Posted: Fri 28 May 2010 10:14
by AndreyR
I have just tried to reproduce the problem using simple tables and failed. Could you please send us (support * devart * com, subject "LINQ: Specified cast is not valid") a small test project illustrating the problem?
Please include the script of the DB object used in the project and some sample data to reproduce the problem on.