in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

NotSupportedException at converting SQLite types (Int64, String) with Entity Framework 4

Last post 08-01-2010 8:43 AM by Jbalzer. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-16-2010 6:29 AM

    NotSupportedException at converting SQLite types (Int64, String) with Entity Framework 4

    Hi All, I'm trying to use System.Data.SQLite with Entity Framework 4 and SQLite3 in a POCO scenario. The EDMX model was successfully created from the SQLite database with the wizard. Then I used the MS POCO Entity Generator. At query execution I get the following NotSupportedException while casting the retrieved properties (here with System.Int64 but also happening with System.String ): "Unable to cast the type 'System.Int64' to type 'System.Object'. LINQ to Entities only supports casting Entity Data Model primitive types." Any idea of what is going on here and how to work around this? This is critical and I'll have to consider alternative technologies if can't get it to work quickly. Any help here would be *very* appreciated! Thanks in advance. Olivier
  • 08-01-2010 6:20 AM In reply to

    • Jbalzer
    • Top 200 Contributor
    • Joined on 09-23-2008
    • TOULOUSE (FRANCE)
    • Posts 8

    Re: NotSupportedException at converting SQLite types (Int64, String) with Entity Framework 4

     Check out my post here http://sqlite.phxsoftware.com/forums/p/2040/9190.aspx#9190.

    It may be the same problem I had while using "Model First" in VS2010.

    Jacques

     

  • 08-01-2010 8:05 AM In reply to

    Re: NotSupportedException at converting SQLite types (Int64, String) with Entity Framework 4

    Thank you Jacques for your reply. I am sorry I did not answer my own question as I've figured out the problem was actually that I was using a wrong Linq expression... Shame on me. It was a port from a Linq2SQL and operations support is different. Thanks for pointing me to the model first approach: we had considered it at first. And I am happy to hear that you guys have managed to leverage it successfully. Olivier
  • 08-01-2010 8:43 AM In reply to

    • Jbalzer
    • Top 200 Contributor
    • Joined on 09-23-2008
    • TOULOUSE (FRANCE)
    • Posts 8

    Re: NotSupportedException at converting SQLite types (Int64, String) with Entity Framework 4

    Glad you find your answer :)

     Jacques

Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems