Technology: .NET, SQL Server 2008 R2, Winforms
Well, for my life I cannot understand this.
First of all, I use a DataTable to store data that comes from a SQL Server 2008 database, and I bind it to a DataRepeater.
I tried to change the binding as follows:
label1.DataBindings.Add("Text", history, "Value", true, DataSourceUpdateMode.Never, "", "N");
which works great with text fields and labels elsewhere but not on DataRepeater. (label1 is part of the ItemTemplate related to DataRepeater)
Since data binding like this does not work, I want to just take my DataTable and just make the column have the format specified above.
And manually changing the data format: (it's floating)
for (int i=0;i < history.Rows.Count;i++) { history.Rows[i]["Value"] = String.Format("{0:N}", history.Rows[i]["Value"]); }
Doesn't work, the datarepeater just changes it.
I want it:
12,123,123.00
and I get the following:
12123123
Any ideas?
source share