0

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?

animuson
  • 53,861
  • 28
  • 137
  • 147
CodeRedick
  • 7,346
  • 7
  • 46
  • 72

1 Answers1

1

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
  • 178,213
  • 47
  • 333
  • 501
  • 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! – CodeRedick Jun 17 '09 at 18:31