Unable to convert MySQL date/time value to System.DateTime
2016-01-22 16:31
429 查看
当使用.NET connector 连接MYSQL数据库,检索某些数据的时候,你可能会得到一个错误信息:
"Unable to convert MySQL date/time value to System.DateTime"
这是因为在日期列中有"0000-00-00"数据值,要修正这个问题,你可以把这些数据设为null,或者在连接字符串中设置"Allow Zero Datetime=True"
例:
<add name="MySqlCon" connectionString="Database=test;Data Source=localhost;User Id=root;Password=123456;pooling=false;CharSet=utf8;Port=3306;allow zero datetime=true"/>
"Unable to convert MySQL date/time value to System.DateTime"
这是因为在日期列中有"0000-00-00"数据值,要修正这个问题,你可以把这些数据设为null,或者在连接字符串中设置"Allow Zero Datetime=True"
例:
<add name="MySqlCon" connectionString="Database=test;Data Source=localhost;User Id=root;Password=123456;pooling=false;CharSet=utf8;Port=3306;allow zero datetime=true"/>
相关文章推荐
- Hadoop源代码中的build-main.xml
- UITableView的属性
- 设计模式之Builder模式
- 华为交换机配置命令 华为QuidWay交换机配置命令手册
- UICollectionView 简单使用
- 建造者模式(Builder Pattern)
- Handler,Message,MessageQueue,AsyncTask,Service小知识点
- 关闭编辑easyui datagrid table
- 第四篇 UITableView
- Android 消息机制---Handler,Looper,MessageQueue,ThreadLocal
- 【HDU】 2818 Building Block
- TBluetoothLEDevice.UpdateOnReconnect
- UIGraphicsBeginImageContext系列知识
- iOS分析UI利器—Reveal及简单破解方法(最新版)
- Gradle build设置自动log开关
- APUE之变量errno总结
- Qt Quick 中的 drag and drop(拖放)
- UITabbarViewController 动态插入选项可行
- Hive学习4_Hive on Spark: Getting Started_Common Issues
- ActionContext类与ServletActionContext类操作request域、session域内的属性