title: Unable to convert MySQL date/time value to System.DateTime.Couldn't store 0/0/0000 0:00:00 value?
body: <pre><code>Me.TreatmentsTableAdapter.Fill(Me.UserDataSet1.treatments)
  </code></pre>
  
  <p>This line  is producing error:</p>
  
  <pre><code>Unable to convert MySQL date/time value to System.DateTime. Couldn't store &lt;0/0/0000 0:00:00&gt; in TreatmentDateEdited Column.  Expected type is DateTime.
  </code></pre>
  
  <p><code>TreatmentDateEdited</code> column is <code>DateTime</code> column that unfortunately contains some <code>NULL</code> values.
  I know that there is a problem in Dataset to convert <code>NULL</code> date to anything else, thus producing me this error.</p>
  
  <ol>
  <li>in connection string I have already added:  <code>AllowZeroDateTime=True</code> but that does not help</li>
  <li>Now from the above error msg I see that <code>NULL</code> value is already converted to <code>0/0/0000 0:00:00</code> but it cant store it in date field.</li>
  </ol>
  
  <p>What date format should I use here in order to have Tableadapter operational ?</p>
  
  <p><strong>EDIT</strong>: I found possible problem here:
  MySQL column of type DateTime doesn't allow me to enter date in any format I tried. I foudn that the default date format is <code>1000-01-01 00:00:00</code> but it wont accept that ! this is the error</p>
  
  <blockquote>
    <p>Invalid value for cell (row 3, column 8).
    The changed value in this cell was not recognized as valid..Net Framework Data Type: MySqlDateTime
    Error Message: Invalid cast from 'System.String' to 'MySql.Data.Types.MySqlDateTime'.</p>
  </blockquote>
  
  <p>So if I cant write date in date column manually neither TableAdapter will do. Any ideas ?</p>
  
  <p>EDIT2: @GoroundoVipa
  The thing is I dont loop dataset but use it as datasource in form controls.
  Here are 2 other things I have noticed:
  1. When using VisualStudio ServerExplorer to access database I am not able to enter new data in datetime field (producing above error)
  2. When I access DB through MySQL workbench I got another error:
  "Error: <code>DB</code>.<code>TABLE</code>: table data is not editable because there is no primary key defined for the table"
  Server:  MySQL
  Version: 5.1.73</p>
  
  <p>How on earth I can not edit table row if it doesn't have PK. It was never required !</p>