InvalidCastException using IQToolKit w/ MySQL

edited August 2012
I'm a long time LinqPad and LINQ to SQL user. I recently needed to start querying a MySQL database, and so downloaded and activated the IQToolkit driver (v2.0.6) via the LinqPad UI. I set up a connection and entities were automatically generated as expected.

However, very basic LINQ queries against most entities fails with an InvalidCastException. Here is an example full C# expression:
  from i in Backlogitemejbs
select i
This throws an InvalidCastException with the message:
Object must implement IConvertible.
There are a few entities I can query just fine. This is a third party MySQL database, and I'm not very familiar with how it is set up, but it does not seem like there should be a way to set up a table that would cause an exception like this from IQToolkit.

Has anyone seen something like this before, or have any ideas what the problem might be?



  • No idea. Can you isolate what's special about the tables you can't query? For instance, try creating a simpler table with half the columns and see if you get the same error.
  • edited May 28
    I am running into the same issue, and it seems to occur when a TEXT(MAX) field is being returned.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!