Page 1 of 1

Key Int32 incompability

Posted: Tue 09 Mar 2010 14:13
by tapczan
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.

Posted: Wed 10 Mar 2010 16:40
by AndreyR
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?