How to use WHERE clause on related table in LinqDataSource

I've used the LinqDataSource successfully with a WHERE clause that applies to the table being selected.

What I need to do now, is select data from the table after using a WHERE clause on a related table instead of the "current" table.

Can this be done with LinqDataSource (I'm using LinqDataSource both for fast prototyping, plus built-in paging capabilities w/ GridView)?

MORE INFO:
I have 2 table objects in my User.dbml:
Provider: List of course providers)
ProviderXUser: Cross-reference table listing which of my website's users (UserDetails table) are also members of a Provider

I tried the following, but it throws the error (I've double-checked that FkUserDetailsId does exist in ProviderXUsers):
"No property or field 'FkUserDetailsId' exists in type 'EntitySet`1'"

        <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="UserDataContext"
        TableName="Providers" Where="ProviderXUsers.FkUserDetailsId == 1 " >
        <WhereParameters>
          <asp:Parameter DefaultValue="1" Name="Type" Type="Int32" />
        </WhereParameters>
      </asp:LinqDataSource>
cdakzAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Aaron JabamaniTechnical ArchitectCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cdakzAuthor Commented:
I looked over http://www.experts-exchange.com/Programming/Languages/.NET/LINQ/Q_24444368.html but it wasn't clear what the solution was to me.

What I was after was a way to use the datasource "wizard" so that I could, through its UI, generate the correct code.

From what I've gathered since posting this question, the way to accomplish this is programmatically, in the _Selecting event, as explained at: http://weblogs.asp.net/scottgu/archive/2007/09/07/linq-to-sql-part-9-using-a-custom-linq-expression-with-the-lt-asp-linqdatasource-gt-control.aspx
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.