How to: Add, Remove, and Modify a Query

A query provides information to screens in your application. A query can also provide information to any custom business logic that you add to the application. You can add, remove or modify queries. For more information, see Queries: Retrieving Information from a Data Source.

To add a query

  1. In Solution Explorer, expand the Data Sources node, expand the desired data source node, and then double-click an entity or table (For example: Contact).

  2. The data designer opens.

  3. On the Command Bar of the Data Designer, click Query.

    A node that represents the query is added to Solution Explorer and the query opens in the Query Designer.

To remove a query

  1. In Solution Explorer, expand the Data Sources node, expand the desired data source node, and then expand the appropriate entity or table (For example: Contact).

  2. Right-click the query that you want to remove, and then click Delete.

To modify a query

  1. In Solution Explorer, expand the Data Sources node, expand the desired data source node, and then expand the appropriate entity or table (For example: Contact).

    Queries appear beneath the node that you expand.

  2. Perform either of the following tasks to modify the query:

    • To rename a query, right-click the query, and then click Rename.

    • To change the contents of a query, double-click the query.

    The query opens in the Query Designer.

Next Steps

To learn how to change the contents of a query, see How to: Design a Query by Using the Query Designer.

To learn how to modify a query in ways that go beyond the capabilities of the query designer, see How to: Extend a Query by Using Code.

To learn more about how to use a query to provide information to a screen, see How to: Filter Data on a Screen.

See Also

Other Resources

Queries: Retrieving Information from a Data Source