Key Int32 incompability

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
tapczan
Posts: 1
Joined: Tue 09 Mar 2010 13:50

Key Int32 incompability

Post by tapczan » Tue 09 Mar 2010 14:13

Hi,
I have database HelpDesk where 2 tables are associated with OneToMany relation. When I lunch my c# application it crashes with this message:

Code: Select all

Unable to cast object of type 'Devart.Data.Linq.EntityCache`2[HelpDesk.podrodzaj,Devart.Data.Linq.Key`2[System.Int32,System.Int32]]' to type 'Devart.Data.Linq.EntityCache`2[HelpDesk.podrodzaj,System.Int32]'.
I don't know if dataContex file is corrupt or column types in database are wrong or something else.

I generated datacontex with reverse enginering wizard. Strange was it didn't created association automatically (like another beetwen other tables and it works fine). I had to create association manually.

I'm almost sure that there is something wrong with that manually added relation but i didn't find anything wrong in datacontext file.

thx for every help and any directions.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 10 Mar 2010 16:40

Could you please post here or send me (support * devart * com, subject "LINQ: Wrong Association") the script of the pair of tables causing the problem?

Post Reply