SQL中的数据类型问题 [英] datatype problem from sql

查看:74
本文介绍了SQL中的数据类型问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

SetConnection();
sql_con.Open();
sql_cmd = sql_con.CreateCommand();
string CommandText = "select id, Information, Set_Point, Uncertinity   from   Informations WHERE Cal_ID ="+i;
DB2 = new SQLiteDataAdapter(CommandText, sql_con);
DS2.Reset();

DB2.Fill(DS2);

DT2 = DS2.Tables[0];
dataGrid1.DataSource = DT2;
sql_con.Close()



当我从Uncertinity调用浮点值"0,0006"时,它看起来像只有"6"一样



When i call the float value "0,0006" from Uncertinity but it appears like only "6"
How can i change type during or before the filling?

推荐答案

您不说这是Windows Forms还是ASP.Net,或者说是WinForms,那么您是否可以更改类型?您可以使用

DataGridView.CellFormatting [ DataGrid.ItemDataBound [ ^ ]可能使您能够做到这一点.
You do not say if this is Windows Forms or ASP.Net, or whatever but if it is WinForms then you could use the

DataGridView.CellFormatting[^] event.

For ASP (I''m not 100% as I don''t do ASP) the DataGrid.ItemDataBound[^] might enable you to do it.


这篇关于SQL中的数据类型问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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