how to select many tables on anonymous queryhttp://forums.asp.net/t/1796490.aspx/1?how+to+select+many+tables+on+anonymous+queryTue, 24 Apr 2012 20:09:07 -040017964904949147http://forums.asp.net/p/1796490/4949147.aspx/1?how+to+select+many+tables+on+anonymous+queryhow to select many tables on anonymous query <p>hi there</p> <p>i have the follow linq query:</p> &lt;div&gt; <pre class="prettyprint">ctx.Contact.Include(&quot;Interlocutor&quot;).Include(&quot;ASI..Include(&quot;Attacth&quot;).include(&quot;customers&quot;) .Where(c =&gt; idOKRAM == null || c.check_ram == idOKRAM)</pre> &lt;/div&gt; <p>how can i have an anonymous type?<br> if i write:<br> select new {d=&gt;d.name..}&nbsp;</p> <p>returns the data only from 1 table!<br> i need return from more table..how can i do?&nbsp;</p> <p>&nbsp;</p> 2012-04-24T17:07:01-04:004949290http://forums.asp.net/p/1796490/4949290.aspx/1?Re+how+to+select+many+tables+on+anonymous+queryRe: how to select many tables on anonymous query <p>You would have to do a Linq join to get data from more than one table</p> <p>&nbsp;</p> <p><a href="http://msdn.microsoft.com/en-us/library/bb311040.aspx">http://msdn.microsoft.com/en-us/library/bb311040.aspx</a></p> 2012-04-24T18:46:42-04:004949317http://forums.asp.net/p/1796490/4949317.aspx/1?Re+how+to+select+many+tables+on+anonymous+queryRe: how to select many tables on anonymous query <p>my manager suggested to use .Include(&quot;table&quot;) function<br> <br> yes. i've seen the link above, thanks a lot<br> can you tel me if it is better use .Include than join?</p> <p></p> <p>thank you&nbsp;</p> 2012-04-24T19:23:07-04:004949382http://forums.asp.net/p/1796490/4949382.aspx/1?Re+how+to+select+many+tables+on+anonymous+queryRe: how to select many tables on anonymous query <p>You use include when you want the data for a related table to be included.&nbsp; So for example you were using the entity framework to pull a table from the northwind database.&nbsp;&nbsp;If you were querying the orders table you would need to use include to get the&nbsp;orderdetails&nbsp;loaded when the data is gotten from the database instead of when you use it.&nbsp;</p> 2012-04-24T20:09:07-04:00