Data Set Designer/Table Adapter Wizard Test with New Stored Procedures
The Data Set Designer/Table Adapter Wizard Test using new stored procedures extends the Data Set Designer Drag-and-Drop Test by adding manipulation of newly created stored procedures to data source objects dropped onto the DataSet designer from the Visual Studio Server Explorer.
Test Procedure
Create a new Windows Application project.
Add a DataSet project item.
From the Toolbox, drag a TableAdapter to the Dataset designer. The TableAdapter Configuration Wizard appears.
On the Choose Your Data Connection page, add a connection to the database using the generic provider.
Make sure the connection is selected in the combo box and click Next.
On the Save the Connection String to the Application Configuration File page, click Next.
On the Choose a Command Type page, select the Create stored procedures option and click Next.
Click the Query Builder button to graphically design your SQL string (or, alternatively, you can type a SQL statement directly in the SQL pane).
After you create the stored procedure, and click Next.
On the Create the Stored Procedures page, enter new stored procedure names or keep the default values. Click Next.
On the Choose Methods to Generate page, keep the default values and click Next.
On the Wizard Results Page, click Finish.
Stored Procedures were created in the database and a TableAdapter was created that is hooked up to the new stored procedures. Verify that the following are correct in the designer:
Columns created for the DataTable
The CommandText property and the Parameters collection on the TableAdapter
Configuration of the Insert, Update, and Delete commands for the CommandText property and Parameters
Repeat steps 3–13 with the following types of SQL statements:
SELECT * FROM Table
SELECT * FROM TableWithoutPrimaryKey
SELECT * FROM TableWithMultipleColumnPrimaryKey
SELECT <some columns> FROM Table
SELECT <different datatypes> FROM Table
SELECT * FROM Table WHERE Column=<NamedParameter>
SELECT * FROM View
SELECT * FROM Function
SELECT COUNT(*) FROM Table WHERE Column=<NamedParameter>
INSERT INTO Table VALUES(<NamedParameter1>,<NamedParameter2,…)
UPDATE Table SET Column1=<NamedParameter> WHERE Column2=<NamedParameter2>
DELETE FROM Table WHERE Column=<NamedParameter>