Hi i have this code and it give me error:
Type of value has a mismatch with column typeCouldn’t store <10/1/2012
3:43:30 PM> in time_in_am Column. Expected type is MySqlDateTime.
my mySQL data type for “time_in_am” is DateTime.
dataRow = dataSet.Tables(0).NewRow()
dataRow("time_in_am") = DateTime.Now
dataSet.Tables(0).Rows.Add(dataRow)
I believe MySQL’s accepted DateTime format is
yyyy-mm-dd hh:mm:ssSo, alter the 2nd row of your code to:
For what each of the format ‘magic strings’ mean, see here
If you find yourself using this often (which is probable) you can create an extension:
Now you can use this in your code as follows: