Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello everybody ,

i have a problem with format , i need to change format of column when i get records from my bank(access) , i use code like this but didnt word :

VB
da.SelectCommand = New OleDbCommand()

        With da.SelectCommand
            .Connection = my_con
            .CommandType = CommandType.Text
            .CommandText = "Select p_name,p_fname,p_mablagh from table1"

            If .Connection.State <> ConnectionState.Open Then
                .Connection.Open()
            End If
        End With

        Dim ds As New Database2DataSet
        da.Fill(ds.Table1)
        Me.DataGridView1.DataSource = ds.Table1
        my_con.Close()
        Me.DataGridView1.Columns(2).DefaultCellStyle.Format = "##,0"



this is my datagridview now :

[URL=http://img4up.com/viewer.php?file=47117885029305385819.jpg][IMG]http://img4up.com/up2/47117885029305385819_thumb.jpg[/IMG][/URL]

((value of column2 show like 12000 but i dont like it i want to show like 12,000))

but i want to change format of column2 like this pic :


[URL=http://img4up.com/viewer.php?file=81408470236125767939.jpg][IMG]http://img4up.com/up2/81408470236125767939_thumb.jpg[/IMG][/URL]

((value of column2 show like 12000 but i dont like it i want to show like 12,000))

*** i get record from bank

please help me
Posted
Updated 16-Mar-12 1:06am
v2

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