Posted by & filed under ADO.NET.

データベースのPGを使うときに以上に便利の方法です。

Data Component Configuration Wizard

This wizard can configure objects that execute insert, update, and delete functionality in the context of the underlying data source. You can use this wizard to specify stored procedures and parameters to insert, update, and delete data in a preconfigured data set based on a stored procedure. You need to start the Data Source Designer before you start the Data Component Configuration Wizard.

Starting the Data Source Designer:

  1. Open the Data Source Designer, right-click the existing table, and then click Configure.

  2. Start the Data Component Configuration Wizard from the designer window. To open the window, click the Edit Data Source with Designer button in the Data Sources window.

    Another option is to right-click the data set shown in the window, and then click Edit Data Source with Designer on the context menu.

    A third option is to go to Solution Explorer and double-click XML Schema Definition for your data source. (It has the .xsd file extension.)

To initiate the Data Component Configuration Wizard, right-click the title bar of the existing data table and click Configure.

Mapping parameters and return values:

  1. Use the Bind Commands to Existing Stored Procedures page to map the parameters in existing stored procedures in the database, to columns returned from the SELECT query.

    The parameter names and source column names do not need to match. You can select any column from the available source columns to map to any parameter in the query.

  2. The wizard can automatically generate useful code for working with the data set.

    For example, specify to create a Fill method that will populate a data set or data table from the underlying database.

  3. The type of command that you choose and configure determines the method available for automatic generation.

    For example, if you configure stored procedures for SELECT, INSERT, UPDATE, and DELETE commands, the Update or change the database option is unavailable.

From:Microsoft

Comments are closed.