title: Column longtext exceeds the MaxLength limit
body: <p>This error occur on modifying data in datable if dt has <code>longtext</code> column.
  First I load datatable:</p>
  
  <pre><code> var command = new MySqlCommand(queryTableData, connection);
   DataTable table = new DataTable();
  
   try
   {
        connection.Open();
        table.Load(command.ExecuteReader());
   }
  </code></pre>
  
  <p>And when I am trying to modify any column data:</p>
  
  <pre><code>table.BeginLoadData();
  for (var i = 0; i &lt; table.Rows.Count; i++)
  {
      table.Rows[i]["columnName"] = value;
  }
  table.EndLoadData();
  </code></pre>
  
  <p>It fails on <code>table.EndLoadData();</code> with error: <code>RowError: "Column 'longtext_val' exceeds the MaxLength limit."</code> Also it sets <code>MaxLength: 0</code> property of <code>longtext</code> column to 0, other properties have normal max length. In database it is set to '4294967295'.</p>
  
  <p>I can avoid this by removing constraints at all:</p>
  
  <pre><code>    using (var reader = command.ExecuteReader())
      {
          DataSet dataSet = new DataSet();
          dataSet.Tables.Add(table);
          dataSet.EnforceConstraints = false;
          table.Load(reader);
      }
  </code></pre>
  
  <p>Last snippet is from <a href="http://bugs.mysql.com/bug.php?id=65065" rel="nofollow">mysql site</a></p>
  
  <p>But it's not an option in my case, it is possible to change max length of this column? Or is there a solution?</p>
  
  <p>P.S. DataType in MySQL looks like:
  name: 'longtext_val', 
  default: NULL, 
  is_nullable: 'YES', 
  data_type: 'longtext', 
  character_max_length: '4294967295', 
  character_set_name: 'utf8', 
  collation_name: 'utf8_general_ci',<br>
  column_type: 'longtext'</p>
  
  <p>Note that I do not know schema in advance, this db is used only for test purposes. </p>
  
  <p>P.S.S. 
  I did not find exact solution so I had to do a workaround. </p>
  
  <p>I thought about two things:
  1. Select only columns that are not <code>longtext</code>
  2. Deal with actual problem - update of datatable. </p>
  
  <p>MySQL datatables throw error row-based, so If you have any error on your column and you are trying to modify any another column - you will get an exception.</p>
  
  <p>MsSQL raises an exception on column-based. So it wont throw an exception if you are trying to modify non-error column.</p>
  
  <p>Thus I get all distinct columns with errors and if column I am interested in threw an exception I will handle:</p>
  
  <pre><code> var errorColumns = table.GetErrors()
      .SelectMany(row =&gt; row.GetColumnsInError()).Distinct().ToList();
  
  if (errorColumns.Any(column =&gt; column.ColumnName == columnMeta.ColumnName))
  {
      //handle
  }
  </code></pre>