title: LINQ to SQL DataContext connection error reporting
body: <p>Okay, so I have this LINQ to SQL situation. I have a DataContext object which links to an SQL database and I can get tables and... all of that business. This is all inside a WCF service inside IIS.</p>
  
  <p>Now I connect the DataContext object when I declare it, which is at the top of the class, as follows:</p>
  
  <pre><code>DataContext dc = new DataContext([ConnectionString]);
  </code></pre>
  
  <p>Then, later, I have methods to do things like inserting a Client (that is a type of entity), and that looks something like this:</p>
  
  <pre><code>public void InsertClient(Client client)
  {
     if(client.ClientID &gt; 0)
        return;
  
     dc.Clients.InsertOnSubmit(client);
  
     dc.SubmitChanges();
  }
  </code></pre>
  
  <p>The problem is basically... is there some way to test that connection? What if someone pulled a plug or something before SubmitChanges? It's not like it returns anything, so it couldn't tell me there was a particular error.</p>
  
  <p>How would people recommend I do this?</p>
  
  <p>Thanks.</p>