.NET Connector, C# MySql DateTime problem.
Posted by: Stefan Larsson
Date: September 07, 2005 03:07PM

Hello!

I have written an application in C#/ ASP.NET, and im using MySQL 4.1.11. (located at an internet provider.)

I have a problem with datetime values. When i use "Query Browser" to run my "Insert Query" generated i C#, i get the right datetime format ex '2005-09-05 19:01:42'. Also when i debug and run my webb application on my developer pc. But when i upload my application to the webserver and runs the application, the date time becomes ''0000-00-00 00:00:00' No matter what format of the date im trying.


Code looks something like this...
*******************************'
string sql = " INSERT INTO TEST1 \n"+
" (DateField) \n"+
" VALUES \n"+
"('"+ DateField.ToShortDateString()+"'"+" )";

MySqlCommand cmd = new MySqlCommand(sql, _conn);
cmd.CommandType = CommandType.Text;
cmd.ExecuteNonQuery();
*********************************

Options: ReplyQuote


Subject
Written By
Posted
.NET Connector, C# MySql DateTime problem.
September 07, 2005 03:07PM


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.