Passing Autumn

The same 3 years, and some people from students to as the MVP, and I was in place, then the code to show off the autumn wind, a little sad, a little cool!

Bulletin
Content is very powerful ~ ~ ~ ~ ~ ~ Do not look outside the invasion not as sharp and brother, I felt kind of sense of loss ~ ~ ~

MySql:Only TimeSpan objects can be serialized by MySqlTimeSpan

刚刚遇到: Only TimeSpan objects can be serialized by MySqlTimeSpan

这个错误,记录一下。

   在 MySql.Data.Types.MySqlTimeSpan.MySql.Data.Types.IMySqlValue.WriteValue(MySqlStream stream, Boolean binary, Object val, Int32 length)
   在 MySql.Data.MySqlClient.MySqlParameter.Serialize(MySqlStream stream, Boolean binary)
   在 MySql.Data.MySqlClient.Statement.SerializeParameter(MySqlParameterCollection parameters, MySqlStream stream, String parmName)
   在 MySql.Data.MySqlClient.Statement.BindParameters()
   在 MySql.Data.MySqlClient.Statement.Execute()
   在 MySql.Data.MySqlClient.PreparableStatement.Execute()
   在 MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   在 MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
   在 MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
   在 CYQ.Data.DAL.DbBase.ExeNonQuerySQL(String cmdText, Boolean isProc) 

一开始以为是Date被折腾成DateTime的问题。。。。。。

经过测试,发现是Time类型的参数,不能用DbType.Time参数传入,需要变更为DbType.String类型传入就正常了。
Autumn Park is QBlog the official site, created by the passing autumn, based on the framework data layers developed cyqdata support multi-user, multi-language, multi-database (access, mssql, oracle), directory level url and other powerful blog system
新浪微博粉丝精灵,刷粉丝、刷评论、刷转发、企业商家微博营销必备工具"

2013/4/10 15:49:34 | Other | |

  • Post Comment