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.