Page 1 of 1

linq runtime error with null value

Posted: Wed 03 Feb 2010 15:08
by fastjem
I use several queries in my application that I check to make sure that a row in the database is not marked as deleted.

var MessageBoardData = (from m in db.MessageBoards
where ((m.IsDeleted == null) || (m.IsDeleted == false))
select m);

With this linq query Im getting a runtime error.
"Unable to cast object of type 'Devart.Data.Linq.Provider.Query.m' to type 'Devart.Data.Linq.Provider.Query.ap'."

If I take out "(m.IsDeleted == null)" from the query, it will work fine. Is there a way to have a query where I can check against a null value.

Thanks for the help.

Posted: Thu 04 Feb 2010 17:54
by StanislavK
Please specify the version of dotConnect for MySQL you are using. Does the problem persist with the latest 5.50.79 version? It is available for download here:
http://www.devart.com/dotconnect/mysql/download.html

Also, you can send us your model. I've failed to reproduce the issue on simple schemas.

Posted: Thu 18 Feb 2010 13:50
by StanislavK
We fixed the problem. Please try the new 5.70.97 Beta build of dotConnect for MySQL. It can be downloaded from
http://www.devart.com/dotconnect/mysql/download.html
(trial version) or from Registered Users' Area (for users with active subscription only).