Connecting Tech Pros Worldwide Forums | Help | Site Map

Help. MySQL OleDbDataAdapter Error Unrepresentable DateTiime

AboutJAV@gmail.com
Guest
 
Posts: n/a
#1: Oct 10 '06
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


AboutJAV@gmail.com
Guest
 
Posts: n/a
#2: Oct 10 '06

re: Help. MySQL OleDbDataAdapter Error Unrepresentable DateTiime


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

Closed Thread