title: Linq fail - A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.Linq.dll
body: <p>I don't understand why I am getting this error. I'm also used to .NET throwing an actual error which I can debug. Instead I am getting the following in the output console:</p>
  
  <pre><code>A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.Linq.dll
  </code></pre>
  
  <p>I have recreated the application and database several times. Oddly, it worked the first time (it was a different app and different db but the process was the same).</p>
  
  <ol>
  <li>create 4.0 windows form app</li>
  <li>create a .mdf database through vs</li>
  <li>create tables on the db</li>
  <li>create the linq to sql file and drag the table onto it.</li>
  <li>enter linq code and run the code. I get the error already mentioned.</li>
  </ol>
  
  <p>The actual code is: </p>
  
  <pre><code>// i changed the variable names before posting so if I spelled cats wrong thats not the problem
  static public void Insert(Cat[] cats)
      {
          using (Cats.lsMapDataContext db = new lsMapDataContext(Global.db_path))
          {
              foreach (Cat cat in cats)
              {
                  history history = new history();
                  history.name = cats.name;
                  history.breed = cats.breed;
                  db.histories.InsertOnSubmit(history);
                  db.SubmitChanges(); // i silently fail here because silent fails are cool and helpful
              }
  
          }
      }
  </code></pre>
  
  <p>Is there some common reason why it might be doing this? The database gets created in Documents for the user I am on (only one for this computer/admin). There are no special access rights that I know of. </p>
  
  <p>Is there a way to hook into that dll so that I can debug it when it crashes? A pdb or something? </p>