Using Datagridview in VB.NET
If u have followed my previous post (method to store the overtime pay data into a datatable), you will now see how to use DataGridView to show the data that you have stored on the screen.
First, on the Visual Basic designer interface, drag the DataGridView from the toolbox to the form. The toolbox can be seen on the left hand side sidebar. If you still can't find it, go to View section on the toolbar, and the select toolbox.
Secondly, drag a button control onto the form as well.
Thirdly, double click on the Button control and the code behind the button will prompt.
Then, type the following code. This code instruct the DataGridView to display data from the first table in the dataset. A zero indicates the first table.
Me.DataGridView1.DataSource = ds.Tables(0)
Lastly, start run the code and click on the button that you just added. You should now see the data in the datatable displayed.
Back to VB Egg
VB.NET : Data Grid View
Posted by Fluffy | 3:19 AM | datagrid datagridview data grid view, VB.NET | 0 comments »
Subscribe to:
Post Comments (Atom)

0 comments
Post a Comment