views:

137

answers:

1

I have two views in SQL, and have created mappings to them in Linq to SQL.

The two views have an association, which works fine, between Ticket.ProblemCode and Problem.Code

When I try to set UIHint("ForeignKey") on Ticket.ProblemCode and run the web page I get the error:

'ProblemCode' is not a foreign key column and cannot be used here.

Anyone know why? More importantly, how to fix it?

+1  A: 

See this post on the ASP.NET forums: http://forums.asp.net/t/1254559.aspx

Also, you said that you created the association in Linq to SQL. Is there an actual PK/FK constraint in the database, or is it only represented in your dbml?

Robert Harvey
It's on two views, so there can't be an actual constraint...
Telos
Ugh... the worst part is I tried that, but accidentally changed the ItemTemplate instead of the EditItemTemplate so I thought it didn't work... Thanks!
Telos