title: How to get the column name which causes the SqlException?
body: <p><strong>Q:</strong> How can i get the column name which causes the <code>SqlException</code>?</p>
  
  <p><strong>C:</strong> I am working with SQL Server. My data which I get from my database is visualized with C# / WPF datagrid / DataTable. </p>
  
  <p>If I want to insert an new datarecord to the database where I for example forgot to put some data in a cell which can not be NULL, I will get a <code>SqlException</code> with the message: </p>
  
  <blockquote>
    <p>Cannot insert the value NULL into column '%.*ls', table '%.*ls';
    column does not allow nulls. %ls fails.</p>
  </blockquote>
  
  <p><code>'%.*ls'</code> is replaced automatically by the columnname which causes the <code>SqlException</code>. </p>
  
  <p>Is there a way to get this column name mentioned in the error message. Or do I have to extract it from the message string myself? </p>