Microsoft Visual Basic 2010 Step by Step eBook

(Tina Meador) #1

462 Part IV Database and Web Programming


within Visual Basic code. Although LINQ is a leading database technology in Visual Studio,
it is not a feature that you can easily master until you have had a little more experience
with SQL statements. In the following exercise, I’ll provide some of this background using
a powerful Visual Studio feature called Query Builder. Query Builder is a visual tool that helps
programmers construct database queries, and it is especially useful for programmers who
have had relatively little exposure to SQL code. In the following example, you’ll use Query
Builder to further organize your Faculty2010DataSet dataset by sorting it alphabetically.

Create SQL statements with Query Builder


  1. On the form, click the Last_NameTextBox object (the first bound object that you
    created to display the last names of faculty members in the Faculty2010 database).

  2. Click the Add Query command on the Data menu.


The Add Query command is available when a bound object, such as Last_NameTextBox,
is selected in the Designer. The Search Criteria Builder dialog box opens, as shown in
the following screen shot:

This dialog box helps you organize and view your queries, which are created by the
Query Builder and consist of SQL statements. The table that your query will filter and
organize by default (Faculty2010DataSet.Faculty) is selected in the Select Data Source
Free download pdf