Problem
You receive the following message when running your application:
Unable to get records. Unable to convert MySQL data/time value to System.DateTime.
In certain versions of MySQL, date values are saved as 0000-00-00 instead of a NULL which causes an error when running your application.
Problem
Step 1: Make sure that date columns in the MySQL database either contains all valid values or contain NULL.
Step 2: Add the “Allow Zero Datetime=true” attribute to your database connection string in your application’s Web.config file, e.g.:
- <add name="Databasesalika1"
- connectionString="Data Source=qaxp-net;Port=3306;
- Database=salika;
- User Id=ironspeed1;Password=ironspeed1;
- Allow Zero Datetime=true"
- providerName="MySql.Data.MySqlClient"
- />
For additional information on this topic:
http://www.ironspeed.com/Designer/9.2.0/WebHelp/Part_VI/Unable_to_convert_MySQL_date_time_value_to_System_DateTime.htm
http://www.ironspeed.com/Designer/9.2.0/WebHelp/Part_VI/Unable_to_convert_MySQL_date_time_value_to_System_DateTime.htm
ไม่มีความคิดเห็น:
แสดงความคิดเห็น