title: EntitySqlException in Entity Framework
body: <p>I am working through the <a href="http://shop.oreilly.com/product/9780596807252.do" rel="nofollow">Programming Entity Framework, 2nd Edition</a> book, the example using <code>Entity SQL</code>.  Changing the name of the context in the example and altering the line</p>
  
  <pre><code>ObjectQuery&lt;Contact&gt; contacts = context.CreateQuery&lt;Contact&gt;(queryString);
  </code></pre>
  
  <p>to</p>
  
  <pre><code>ObjectQuery&lt;Contact&gt; objectQuery = ((IObjectContextAdapter)context).ObjectContext.CreateQuery&lt;Contact&gt;(QUERY_STRING);
  </code></pre>
  
  <p>I get this:</p>
  
  <pre><code>using (var context = new PROGRAMMINGEFDBEntities())
  {
      const string QUERY_STRING = "SELECT VALUE c" +
                                  "FROM PROGRAMMINGEFDBEntities.Contacts AS c " +
                                  "WHERE c.FirstName='Robert'";
      ObjectQuery&lt;Contact&gt; objectQuery = ((IObjectContextAdapter)context).ObjectContext.CreateQuery&lt;Contact&gt;(QUERY_STRING);
      foreach (var contact in objectQuery)
      {
          Console.WriteLine("{0} {1}", contact.FirstName, contact.LastName);
      }
  }
  </code></pre>
  
  <p>When it is run, I get the following exception:</p>
  
  <pre><code>System.Data.Entity.Core.EntitySqlException was unhandled
    HResult=-2146232006
    Message=The query syntax is not valid. Near identifier 'PROGRAMMINGEFDBEntities', line 1, column 20.
    Source=EntityFramework
    Column=20
    ErrorContext=identifier 'PROGRAMMINGEFDBEntities', line 1, column 20
    ErrorDescription=The query syntax is not valid.
  </code></pre>