The Data Adapter Configuration Wizard runs you through the entire process of creating a data adapter (and, if necessary, a data connection). The wizard accomplishes the following:
Creates the adapter.
If necessary, creates a data connection and sets the adapter to use the connection.
Creates the SQL statement or stored procedures used to read and write data.
Creates and configures parameters for the SQL statements or stored procedures so that the commands read and write the correct data.
Maps table and column names between the database and the dataset.
Configuring the Command Objects
The main part of the wizard's work is in configuring the four data command objects that the adapter uses to pass data to and from the database. These include the SelectCommand object, and optionally, the UpdateCommand, InsertCommand, and DeleteCommand objects. Each of these objects contains either a SQL statement or the name of a stored procedure used to read and write data. The properties of each of these commands (especially the CommandText property) are set according to choices you make in the wizard.
The wizard allows you to use either SQL statements or stored procedures for the commands. It gives you these options:
Use SQL statements. You can specify a Select statement, and if you choose to create them, the wizard builds corresponding Update, Insert, and Delete statements based on what you have included in the Select statement. The Update and Insert statements include parameters to pass new values. The Update, Insert, and Delete statements include parameters in a WHERE clause to locate the correct record in the database.
Create new stored procedures. This option is similar to using a statement, except that the wizard generates stored procedures instead of statements. Because stored procedures can be faster than SQL statements, you might choose this option for performance. In this option, the wizard generates stored procedures for all four commands (again based on what you specify in the Select command). You can choose to have the new stored procedures written to your database. If you don't, you can still capture the SQL script that the wizard would use to create the stored procedures, and you can execute the script yourself later.
Use existing stored procedures. In this option, you pick stored procedures for each of the four commands. The wizard displays the names and details of stored procedures that it can find in the database. This option is useful if you already have stored procedures that perform the four database operations.