title: Alternative to using String.Join in Linq query
body: <p>I am trying to use the Entity Framework in my ASP MVC 3 site to bind a Linq query to a <code>GridView</code> datasource. However since I need to pull information from a secondary table for two of the fields I am getting the error </p>
  
  <p><code>LINQ to Entities does not recognize the method 'System.String Join(System.String, System.Collections.Generic.IEnumerable'1[System.String])' method, and this method cannot be translated into a store expression.</code></p>
  
  <p>I would like to be able to do this without creating a dedicated view model. Is there an alternative to using <code>String.Join</code> inside a Linq query? </p>
  
  <pre><code>var grid = new System.Web.UI.WebControls.GridView();
  
  //join a in db.BankListAgentId on b.ID equals a.BankID
  var banks = from b in db.BankListMaster
      where b.Status.Equals("A")
      select new
      {
          BankName = b.BankName,
          EPURL = b.EPURL.Trim(),
          AssociatedTPMBD = b.AssociatedTPMBD,
          FixedStats = String.Join("|", from a in db.BankListAgentId
                                        where a.BankID == b.ID &amp;&amp;
                                        a.FixedOrVariable.Equals("F")
                                        select a.AgentId.ToString()),
          VariableStats = String.Join("|", from a in db.BankListAgentId
                                           where a.BankID == b.ID &amp;&amp;
                                           a.FixedOrVariable.Equals("V")
                                           select a.AgentId.ToString()),
          SpecialNotes = b.SpecialNotes,
      };
  
  grid.DataSource = banks.ToList();
  grid.DataBind();
  </code></pre>