witecloner
Well-known member
- Joined
- Feb 12, 2009
- Messages
- 45
- Programming Experience
- Beginner
Hi all, i am newbie in vb.net
could anybody tell me how can i format the data in datagridview. to clear this question here above my source.
Result :
-----------------------------------------------------
| ID | Divisi Name | Salary |
------------------------------------------------------
|1 | Staff | 1.000,0000 |
|2 | Cashir | 5.00,0000 |
------------------------------------------------------
How can i manipulate the salary value? i mean i just want to display 2 digit precision in datagridview table.
Thank you
could anybody tell me how can i format the data in datagridview. to clear this question here above my source.
VB.NET:
Dim sAdapter As New SqlDataAdapter
Dim sCmdBuilder As New SqlCommandBuilder
Dim sDataTable As New DataTable
Dim ConText As string = "Data Source=.\SQLEXPRESS;Initial Catalog=TSMMaspion; Integrated Security = True;Pooling=False"
Dim SqlText As String
Private Sub Form_Load(...)
SqlText = "SELECT * FROM Divisi"
sAdapter = new SqlDataAdapter(SqlText, ConText)
sCmdBuilder = New SqlCommandBuilder(sAdapter)
sDataTable = new DataTable()
sDataTable.Locale = System.Globalization.CultureInfo.InvariantCulture
sAdapter.Fill(sDataTable)
DataGridView1.DataSource = sDataTable
End Sub
Result :
-----------------------------------------------------
| ID | Divisi Name | Salary |
------------------------------------------------------
|1 | Staff | 1.000,0000 |
|2 | Cashir | 5.00,0000 |
------------------------------------------------------
How can i manipulate the salary value? i mean i just want to display 2 digit precision in datagridview table.
Thank you