Category Archives: .NET Dark Arts

LinqDataSource join

Hi guys,

If you are ever using a LinqDataSource and want to join a second table, bad news, you can’t. BUT if your edmx file sees the join between the tables, you can still reference it.

See following extract from the ASP.NET file:

<asp:LinqDataSource ID="LinqDataSource1" runat="server"
ContextTypeName="MyDatabase.MyDatabaseEntities" EntityTypeName=""
OrderBy="DateCreated desc"
Select="new (ID, Name, Author.Name AS Author)"
TableName="Posts">
</asp:LinqDataSource>