
Use Existing Stored Procedures
This section explains how to complete the TableAdapter Configuration Wizard when selecting the Use existing stored procedures option.
Bind Commands to Existing Stored Procedures
Select the stored procedure to execute for the SELECT, INSERT, UPDATE, and DELETE commands of the TableAdapter. These stored procedures are executed when the associated methods are called on the TableAdapter. For example, the stored procedure assigned to the Update command is executed when the TableAdapter.Update() method is called.
Map parameters from the selected stored procedure to the corresponding columns in the data table. For example, if your stored procedure accepts a parameter named @CompanyName that it passes to the CompanyName column in the table, set the Source Column of the @CompanyName parameter to CompanyName.
Note: |
|---|
The stored procedure assigned to the SELECT command is executed by calling the method of the TableAdapter that you name in the next step of the wizard. The default is
Fill, so the typical code to execute the SELECT procedure is TableAdapter.Fill(tableName). Substitute Fill with the name you assign if you change it from the default of Fill, and replace "TableAdapter" with the actual name of the TableAdapter (for example, CustomersTableAdapter).
|