Add Delete user, this is also related to the database table information Ah! In VB, we can easily call SQL statements with the control of the perfect combination, in vb.net of course there is a more humane way: directly using the control to connect to the database
Specific steps:
To connect to a data source:
Select the table or view or stored procedure that you want, and simply use the statement to display the data in the user table in the DataGridView Control.
You can modify the corresponding name:
This will show you the information you need, of course, you can edit the row, column, delete the information you do not need
so as soon as one runs, it will appear User table all the information, but this is not what we want, we need is the user level separation effect, we can add the query, gross position query hidden, of course, remember the query name and the corresponding query statement modified, you can click the Query Builder to see if the query is correct, Then click OK to do so.
The automatically generated code is as follows:
Private Sub Administrator Toolstripbutton_click (sender as Object, e as EventArgs) Handles Administrator Toolstripbutton.click Try ' Error statement, which executes the SQL statement me.t_usertableadapter about the administrator before writing . Administrator (Me.UserChose.T_User) Catch ex as System.Exception System.Windows.Forms.MessageBox.Show (ex. Message) End Try End Sub
Knowledge Supplement:
Perceptions of Bindingcource: Span class= "Selflink" > bindingsource Elements serve a variety of purposes.   First, it simplifies the By providing money management, change notifications and other services in Windows Forms controls and data sources   use DataSource property, by attaching to the of the data source; bindingsource components to complete.
The above is their own initial understanding of it! For the database of learning really have to package onion-like, one layer of execution, because when the package to the last time will find that the original before each step of their own is the essence of the.