title: Linq to SQL intellisense has no knowledge of tables within the datacontext object
body: <p>I can successfully connect to the database with my datacontext object.  I am able to read and write to the database successfully, however I can't use the same syntax that others appear to be using.</p>
  
  <p>For example, when I want data from a table, I have to do something like this:</p>
  
  <pre><code>db = new UserDataDataContext(WebConfigurationManager.ConnectionStrings["UserData"].ConnectionString);
  IQueryable Users = db.GetTable&lt;User&gt;();</code></pre>
  
  <p>I'd like to be able to write linq queries like how I see others doing them:</p>
  
  <pre><code>db = new UserDataDataContext(WebConfigurationManager.ConnectionStrings["UserData"].ConnectionString);
  var query = from u in db.User
              where u.UserName == "Test"
              select u;
  </code></pre>
  
  <p>But intellisense does not recognize User as an property of db, and thus won't compile.  Intellisense doesn't show any properties that look related to tables or entities of my database.</p>
  
  <p>Here is the error message I am getting:</p>
  
  <pre><code>'System.Data.Linq.DataContext' does not contain a definition for 'User' and no extension method 'User' accepting a first argument of type 'System.Data.Linq.DataContext' could be found (are you missing a using directive or an assembly reference?)</code></pre>
  
  <p>Here is a rundown of what I am doing:</p>
  
  <p>I used the database designer, dragged the tables in that I wanted.</p>
  
  <p>Then I saved it as a dbml file.</p>
  
  <p>It then created the new class that extends dataContext for me, named UserDataDataContext.  I then instantiate a new instance of UserDataDataContext named db, passing in my connection string from Web.config.</p>
  
  <p>Then I try to write a linq query referencing table names as properties of the db object, but it does not recognize them.</p>
  
  <p>I can't seem to find what I am doing wrong compared to all of the examples I've read.  Any ideas?</p>