title: Get the line number on which the request to database ended with an error
body: <p>I use this code to send a SQL request:</p>
  
  <pre><code> SqlBulkCopy bulkCopy = new SqlBulkCopy(Connection);
  
   foreach (DataColumn column in dt.Columns)
   {
       bulkCopy.ColumnMappings.Add(column.ColumnName, column.ColumnName);
   }
  
   bulkCopy.DestinationTableName = "nsi." + classifierData.Info.TableName;
   bulkCopy.WriteToServer(dt);
  </code></pre>
  
  <p>and get this exception : </p>
  
  <blockquote>
    <p>Received an invalid column length from the bcp client for colid</p>
  </blockquote>
  
  <p>Is there any way to identify which row is causing the error?</p>
  
  <p>I've tried to use this, but it doesn't work (values are always the same):</p>
  
  <pre><code> FieldInfo currentRow = typeof(SqlBulkCopy).GetField("_currentRowLength", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance);
   var currentRowNumber = currentRow.GetValue(bulkCopy);
  
   FieldInfo _rowsCopiedField = typeof(SqlBulkCopy).GetField("_rowsCopied", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance);
   var currentRowN = _rowsCopiedField.GetValue(bulkCopy);
  </code></pre>
  
  <p>Please, help me anyone ...</p>