Search Criteria Builder Dialog Box
Complete this dialog box to add a new query (typically a parameterized query) to an existing data-bound form in your Windows application. This includes adding a new query to the selected table, and adding controls for users to input any parameter values on the form (a button to execute the query is also added to the form).
A parameterized query returns data that meets the conditions of a WHERE clause in the query. For example, you can parameterize a customer list to display only customers in a certain city by adding WHERE City = @City to the end of the SQL statement that returns a list of customers. The WHERE clause defines a condition to be met when executing a query. SELECT * FROM Customers returns all records in the Customers table, whereas SELECT * FROM Customers WHERE City = @City only returns records in which the City column equals the value of the @City parameter. Add a WHERE clause that makes sense to the end of your query.
Some typical WHERE clauses:
SELECT * FROM Employees WHERE CompanyName like @CompanyName SELECT * FROM Employees WHERE (LastName = @Lname) and (FirstName = @Fname)
The syntax for parameter placeholders varies depending on the data source. This example shows placeholders for a SQL Server data source (@paramname). Use question mark (?) placeholders for System.Data.OleDb and System.Data.Odbc parameters (WHERE CompanyName like ?).
This dialog box appears when Add Query is chosen on a smart tag or from the Data menu.
Using this dialog box, you can:
Add search functionality to an existing data-bound form in a Window application. For more information, see How to: Add a Parameterized Query to a Windows Forms Application.