title: The multi-part identifier could not be bound C# and SQL
body: <p>I'm trying to execute a SQL query for a WCF service because the database I'm using doesn't have a stored procedure to return data I need.  You can see the code below. I'm using VS2010 and connecting to Microsoft SQL Server. The Exception I get is: The multi-part identifier could not be bound. Thanks for the help. </p>
  
  <pre><code>        public List&lt;ObjectCodeGroup&gt; GetObjectCodeGroup()
      {
          TCDataDataContext dc16 = new TCDataDataContext();
          List&lt;ObjectCodeGroup&gt; results = new List&lt;ObjectCodeGroup&gt;();
  
          var objectCodeResults = dc16.ExecuteQuery&lt;ObjectCodeGroup&gt;(@"select t1.codeid," +
              "t1.code, t1.catalogtype, t1.codegroup, t1.codetext, t1.codegrouptext, t1.codedesc, t1.state_id from CODES t1" +
  
              "inner join ( select MIN(codeid) codeid, codegroup from CODES group by codegroup)" +
                  "t2 on t1.codeid = t2.codeid and t1.codegroup = t2.codegroup WHERE catalogtype = 11");
  
          foreach (ObjectCodeGroup o in objectCodeResults)
          {
              results.Add(new ObjectCodeGroup()
             {
                 codegrouptext = o.codegrouptext
             });
          }
  
          return results;
      }
  </code></pre>