Tuesday, 10 September 2013

Using SQL views in asp.net dynamic data site

Using SQL views in asp.net dynamic data site

I've spent a fair while googling and haven't been able to get a definitive
answer to this.
I'm reasonable new to asp.net but have created a dynamic data site which
is all working when i use database tables in my dbml, however if i try and
link to a view in the database it is automatically displayed by the
scaffolding but no hyperlink to the table it links to.
Is this possible?
An example of what i'm working with:
This works:
TableA: id
TableB: id, TableA_id
When i view Table A, i get a field with "View TableBs", When i look at
TableB i see a link to "TableA"
However when i have this:
ViewA: id
TableB: id, ViewA_id
Looking at ViewA in the browser there's nothing for TableB, Looking at
TableB i can see ViewA_id but it's just text and not a link.
I've tried creating a partial class and using the UiHint(ForiegnKey) but
this gave an error (assuming because it's not a real FK field in the DB).
Thanks in advance!

No comments:

Post a Comment