linq runtime error with null value

linq runtime error with null value

Postby fastjem » Wed 03 Feb 2010 15:08

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.
fastjem
 
Posts: 3
Joined: Wed 03 Feb 2010 14:59

Postby StanislavK » Thu 04 Feb 2010 17:54

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.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby StanislavK » Thu 18 Feb 2010 13:50

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).
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48


Return to dotConnect for MySQL