Author: Mainship | Posted on: 10/7/2009 4:12:38 PM | Views : 265

I have two tables, blogs and members.  Both have ID fields that are primary keys.  Blogs also has a nvarchar(25) field called filenum.  Members has a nvarchar(25) field called file2.  I have a listview control that has a linqdatasource called ldsblogs.  In order to get a dynamic query that needed data from both tables to work right on another page, in the dbml I created an association from members->File2 to Blogs->filenum.  It's this asociation that's causing the problem, because if I remove it this page works fine.  If I have it in place, I get a System.InvalidCastException: Specified cast is not valid error.   I can't remove the association though because of the other page.

I tried to use a sqldatasource hoping it would ignore the association, but I g ...

Go to the complete details ...