次の方法で共有


Data Set Designer/Table Adapter Wizard Test with SQL Statements

The Data Set Designer/Table Adapter Wizard Test using SQL statements extends the Data Set Designer Drag-and-Drop Test by adding manipulation of SQL statements to data-source objects dropped onto the DataSet designer from the Visual Studio Server Explorer.

Test Procedure

  1. Create a new Windows Application project.

  2. Add a DataSet project item.

  3. From the Toolbox, drag a TableAdapter to the Dataset designer. The TableAdapter Configuration Wizard appears.

  4. On the Choose Your Data Connection page, add a connection to the database using the generic provider.

  5. Make sure the connection is selected in the combo box and click Next.

  6. On the Save the Connection String to the Application Configuration File page, click Next.

  7. On the Choose the Command Type page, select the Use SQL statements option and click Next. The SQL pane is now visible.

  8. Click the Query Builder button to graphically design your SQL string (or, altneratively, you can type a SQL statement directly in the SQL pane).

  9. Verify that the results are as expected by executing the query in Query Builder, and then click OK to dismiss the Query Builder.

  10. Click Next.

  11. On the Choose Methods to Generate page, leave the default values and click Next.

  12. On the Wizard Results Page, click Finish.

  13. A TableAdapter is created using the SQL statement you entered. Verify the following in the designer:

    1. The DataTable and TableAdapter names

    2. Columns created for the DataTable

    3. The configuration of the Insert, Update, and Delete commands for the CommandText property and Parameters collection

  14. Repeat steps 3–10 with the following types of SQL statements:

    1. SELECT * FROM Table

    2. SELECT * FROM TableWithoutPrimaryKey

    3. SELECT * FROM TableWithMultipleColumnPrimaryKey

    4. SELECT <some columns> FROM Table

    5. SELECT <different datatypes> FROM Table

    6. SELECT * FROM Table WHERE Column=<NamedParameter>

    7. SELECT * FROM View

    8. SELECT * FROM Function

See Also

Concepts

Validating End User Applications of DDEX

Data Set Designer Drag-and-Drop Test