Now that you have seen how to display an entire database table in a DataGridView, we demonstrate how to execute specific SQL SELECT queries on a database and display the results. Although this example only queries the data, the application could be modified easily to execute other SQL statements. Perform the following steps to build the example application, which executes custom queries against the Titles table of the Books database.
Creating the Project First, create a new Windows Application named DisplayQueryResult. Rename the Form FrmDisplayQueryResult and name its source file FrmDisplayQueryResult.vb, then set the Form’s Text property to Display Query Result.
Adding a Data Source to the ...