Help. MySQL OleDbDataAdapter Error Unrepresentable DateTiime

  • Thread starter Thread starter AboutJAV
  • Start date Start date
A

AboutJAV

Hi,

I am performing a query on MySQL table which contains two DateTime
fields

Here is my code


string sqlCmd = "SELECT * FROM categories";
OleDbDataAdapter da = nwe OleDbDataAdapter(sqlCmd, this.connection);
DataTable table = new DataTable(TableName);
da.Fill(table);
return table;




When it hits da.Fill(table);

The error is

Parameter name: Year, Month, and Day parameters describe an
unrepresentable DateTime
 
Also, I noticed that the DateTime format in MySQL is 2006-06-28

In C#, the DateTime format is 06/28/2006

I need to read and save the datetime as 2006-06-28. How can I do this?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top