C#中mysql诡异的Date_format返回base64string的问题

来源:互联网 发布:淘宝店铺头像怎么设计 编辑:程序博客网 时间:2024/05/16 01:59

以前的一个项目中 写了一个webservices 。其中返回时间函数的时候调用的是date_FORMAT(时间,格式)  返回定义的时间。以前能够正常工作。这段时间由于服务器mysql数据库版本变化了(变化成了5.0.15)。突然一下 webservices中的时间都变成了base64编码。


早了很久的问题。测试的时候。 直接用select date_format(时间 ,格式) from 表,在c#客户端存入 data table 发现里面的类型是system.byte[];

而用其他数据库版本的时候。直接用select date_format(时间 ,格式) from 表,在c#客户端存入 data table 发现里面的类型是system.string;

诡异的问题。


最后修改方法 : select  cast(date_format(时间,格式) , char(30)  from 表

结果正确

原创粉丝点击