Sep 06, 2011 04:15 AM|pizzamaker74|LINK
There are two tables
Table1 - Contains the columns I want to return
Table2 - Has a foreign key to Table1
- Has a column I need to filter Table1 records on
I want to join on the foreign key and then filter on Table2 to return records from Table1
I want to use Dynamic Data to do this.
I have done so easily with one table, but not sure on how to do so with two.
I'm using Linq to SQL for my DataContext.
I'm not sure how to do this. I really like the way Dynamic Data sorts out my paging and controls, so would prefer if I could continue to do it this way.
Does anyone have any ideas? -
I really want to continue using Dynamic Data for this.
Do I need to use Stored Procedures or is there some other way?
I know I can solve the query with Linq to SQL but I don't know how I can then include this in the Dynamic data.
See Linq Query below for query.
MainDataContext tDC = new MainDataContext();
IEnumerable results = from o in tDC.Table1
from a in tDC.Table2
where a.filterfield == "FilterText"
If anyone has any good examples of what I'm trying to do I'd appreciate greatly.