in

System.Data.SQLite

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

Guid in Database Query

Last post 07-07-2010 8:12 AM by Chris1980. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 07-07-2010 8:12 AM

    Guid in Database Query

    Hello!

    I have the following problem using a query which joins some tables which use guids as Primary keys:

    When i execute the query 

    IQueryable<Instance> query = from item in Context.Instances
                                                 .Include("Artist")
                                                 ...                                            
                               where item...
                               select item;          
                var list = query.ToList();

    I always get the following error when executing the ToList()-Method

    "The type of the key field 'Id' is expected to be 'System.Guid', but the value provided is actually of type 'System.Byte['."

    I already tried to use the BinaryGuid=False in the connection-string, but all it does is ending up with an equal error-message but with

    "System.String" instead of "System.Byte[".

    Anyone any idead how i can deal with this?

     

    Already thank you very much!

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