<p>Have been trying out the new Dynamic Data site create tool that shipped with .NET 3.5.  The tool uses LINQ Datasources to get the data from the database using a .dmbl context file for a reference. I am interseted in customizing a data grid but I need to show data from more than one table.  Does anyone know how to do this using the LINQ Datasource object?</p>

[{'answer_id': 66119, 'author': 'Jarrett Meyer', 'author_id': 5834, 'author_profile': 'https://Stackoverflow.com/users/5834', 'pm_score': 0, 'selected': False, 'text': '<p>You cannot put more than one object/datasource on a datagrid. You will have to build a single ConceptObject that combines the exposed properties of the part Entities. Try to use DB -> L2S Entities -> ConceptObject. You must be very contrived if the DB model matches the ConceptObject field-for-field.</p>\n'}, {'answer_id': 66292, 'author': 'user7116', 'author_id': 7116, 'author_profile': 'https://Stackoverflow.com/users/7116', 'pm_score': 2, 'selected': False, 'text': '<p><em>(EDIT misunderstood the question, revising my answer to the following)</em></p>\n\n<p>Your LinqDataSource could point to a view, which allows you to overcome the problem of not being able to express a Join in the actual element. From <a href="http://msdn.microsoft.com/en-us/library/bb384396.aspx" rel="nofollow noreferrer">"How to: Create LINQ to SQL Classes Mapped to Tables and Views (O/R Designer)"</a>:</p>\n\n<blockquote>\n  <p>The O/R Designer is a simple object relational mapper because it supports only 1:1 mapping relationships. In other words, an entity class can have only a 1:1 mapping relationship with a database table or view. Complex mapping, such as mapping an entity class to multiple tables, is not supported. However, you can map an entity class to a view that joins multiple related tables.</p>\n</blockquote>\n'}, {'answer_id': 71505, 'author': 'MrHinsh - Martin Hinshelwood', 'author_id': 11799, 'author_profile': 'https://Stackoverflow.com/users/11799', 'pm_score': 0, 'selected': False, 'text': '<p>You are best using a ObjectDataSource when you wnt to do more complex Linq and bind your Grid to the ObjectDataSource.\nYou do however need to watch out for Anonymous types that could give you some trouble, but anything is posible...</p>\n'}, {'answer_id': 84141, 'author': 'naspinski', 'author_id': 14777, 'author_profile': 'https://Stackoverflow.com/users/14777', 'pm_score': 3, 'selected': True, 'text': '<p>If the tables are connected by a foreign key, you can easily reference both tables as they will be joined by linq automatically (you can see easily if you look in your dbml and there is an arrow connecting the tables) - if not, see if you can add one.</p>\n\n<p>To do that, you can just use something like this:</p>\n\n<pre><code>&lt;%# Bind("unit1.unit_name") %&gt;\n</code></pre>\n\n<p>Where in the table, \'unit\' has a foreign key that references another table and you pull that \'unit\'s property of \'unit_name\'</p>\n\n<p>I hope that makes sense.</p>\n'}]
['https://Stackoverflow.com/questions/66094', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9626/']