Date Conversion
Posted by: Kendal Goodrich
Date: December 03, 2004 02:48PM

I recently converted to using the MySql Connector .NET from using CoreLab MySqlDirect.NET. I have a piece of code within C# in which I pull a datarow from the database and try to pull MySqlDbType.Date value from the datarow and convert it to a System.DateTime value. When I do, I get an Invalid Conversion Error. Why is that????? I previously did not have that problem, the conversion went smooth with CoreLab. I would much rather use MySqlConnector, but I would like to know what the problem is??? Here is the line of code where I am getting the error:

return Convert.ToDateTime(dbvalue);//dbvalue is an object holding a MySql.Data.Types.MySqlDateTime

I found a workaround by using the following approach

return Convert.ToDateTime(dbvalue.ToString());

Any assistance is greatly appreciated.

Thanks,
Kendal

Options: ReplyQuote


Subject
Written By
Posted
Date Conversion
December 03, 2004 02:48PM
December 10, 2004 02:30PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.