mysql数据在vb.net运行时期间在datatable中显示system.byte [英] mysql data display system.byte in datatable during runtime in vb.net

查看:154
本文介绍了mysql数据在vb.net运行时期间在datatable中显示system.byte的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个选择查询,我从mysql表数据库中选择一列并将其存储到数据表中,然后再将其显示在水晶报表中。当我运行我的项目时,没有发生错误,但是水晶报告中没有数据显示,当我设置断点并检查我的数据表包含时,在我要显示的列中写入类似System.byte的内容假设是我从数据库中选择的显示数据。为什么会这样?还有其他办法可以解决这个问题吗?





 SELECT CONCAT(LPAD(FLOOR(extra_ot / 60) ),2,'0'),':',LPAD((extra_ot MOD 60),2,'0'),':00')AS Extra_O 

解决方案

你必须先把它作为char。

  SELECT  CONCAT(强制转换(LPAD(FLOOR(extra_ot / 60), 2 '  0' as   char  20 )),' :',cast(LPAD((extra_ot MOD < span class =code-digit> 60 ), 2 '  0' as   char  20 )),' :00' AS  Extra_O 


在连接设置中添加此功能可以解决问题:

;允许用户变量= True;尊重二进制标志= false


hallo everyone,

i have an select query where i select one column from mysql table database and store it into datatable before i display it in crystal report. when i run my project, there is no error Occurred, but there is no data display in the crystal report, when i set a breakpoint and check my datatable contain, in the column that i want to display write something like "System.byte" suppose to be display data that i select from the database. why it is happend? is any others way for me to fix it?


SELECT CONCAT(LPAD(FLOOR(extra_ot/60),2,'0'),':',LPAD((extra_ot MOD 60 ),2,'0'),':00') AS Extra_O

解决方案

You have to cast it as a char first.

SELECT CONCAT(cast(LPAD(FLOOR(extra_ot/60),2,'0') as char(20)),':',cast(LPAD((extra_ot MOD 60 ),2,'0') as char(20)),':00') AS Extra_O


Adding this in connection settings did the trick : 

;Allow User Variables=True;Respect Binary flags=false


这篇关于mysql数据在vb.net运行时期间在datatable中显示system.byte的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆