title: Linq to SQL Error Mapped
body: <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;   
  using System.Data;
  using System.Data.SqlClient;
  using System.Data.Linq;
  using System.Threading.Tasks;
  
  namespace dbtst
  {
          class person { public int id; public string name;}
  
          class Program
          {
              static void Main(string[] args)
              {
                  DataContext db = new DataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\UDMS\Documents\uhby.mdf;Integrated Security=True;");
                  Table&lt;person&gt; tble = db.GetTable&lt;person&gt;();
  
                  person a = new person();
                  a.id = 5;
                  tble.InsertOnSubmit(a);
                  person b = new person();
                  a.id = 6;
                  tble.InsertOnSubmit(a);
                  IEnumerable&lt;person&gt; query = from p in tble
                                              where p.id == 5
                                              select p;
  
                  foreach (person e in query) { Console.WriteLine("{0}{1}", e.id, e.name); }
          }
      }
  }
  </code></pre>
  
  <p>I've been trying to test Linq-to-SQL.</p>
  
  <p>The error is:</p>
  
  <blockquote>
    <p>A first chance exception of type 'System.InvalidOperationException' occurred in System.Data.Linq.dll<br>
    An unhandled exception of type 'System.InvalidOperationException' occurred in System.Data.Linq.dll<br>
    Additional information: The type 'dbtst.person' is not mapped as a Table.  </p>
  </blockquote>