Room charge system A lot of functions are related to the data in the table display, in VB 6.0 knocked the first time room, we apply to the control MSHFlexGrid, and. NET application is DataGridView, feel DataGridView more powerful, but also very convenient, can be directly and database binding, to achieve the operation of the database, you can also use code to operate the DataGridView, to achieve the corresponding functions.
DataGridView control has many advantages, it can not only display data flexibly, but also can easily define the appearance of the control, through a line of code to achieve data binding, complete visualization operation, convenient and many.
Next introduce the DataGridView Direct binding method:
1, control binding: One minute to achieve data display
Using DataSource settings, bind the database to show the teacher's work record as an example:
1) Add a data source
Select Database--Data set
2) Add link
Then test it and go to the next step after the test is successful
3) Select the database object and select the part you want to display
4) Edit column change header name, set up query statement, select Teacher Login status =ture
5) Display Results
Simple and easy Five steps, you can realize the teacher on duty query! Direct binding data source code is small, automatic completion of queries, convenient and fast, the real realization of automation.