title: Fetch Linq to Entity result directly into Datatable
body: <p>I am trying to make dynamic menu using <strong>Linq and entity</strong>. I wants to add query result directly into datatable. select query (as shown below)  throws an exception.
  Exception: </p>
  
  <blockquote>
    <p>LINQ to Entities does not recognize the method 'System.Data.DataRow
    LoadDataRow(System.Object[], Boolean)' method, and this method cannot
    be translated into a store expression</p>
  </blockquote>
  
  <p>Is there alternative? Here below is my code.</p>
  
  <pre><code>DataTable dtMenu = new DataTable();
  dtMenu.Columns.Add("MenuName", typeof(string));
  dtMenu.Columns.Add("SubMenuName", typeof(string));
  dtMenu.Columns.Add("FileName", typeof(string));
  
  var menuItems = (from vUser in dbMenu.VirtualUserMenuMaps
  join menu in dbMenu.MenuMasters on vUser.MenuId equals menu.MenuId
  join subMenu in dbMenu.SubMenuMasters on vUser.SubMenuId equals subMenu.SubMenuId
  where vUser.VirtualId == virtualId
  orderby menu.MenuId, subMenu.DisplayOrder
  select dtMenu.LoadDataRow(
  new object[] { menu.MenuName, subMenu.SubMenuName, subMenu.FileName }, false));
  </code></pre>