Click here to Skip to main content
15,880,132 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
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()


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?
Posted
Updated 5-Apr-11 5:00am
v2
Comments
Sandeep Mewara 5-Apr-11 11:01am    
When i call the float value "0,0006" from Uncertinity but it appears like only "6"
While selecting from database?
Chucky64 5-Apr-11 12:33pm    
No after fill.

1 solution

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.
 
Share this answer
 
Comments
Chucky64 5-Apr-11 12:32pm    
It's Windows forms and i will try it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900