About ADO.NET dataset integration

You can easily connect forms to Web services that receive data from and submit data to ADO.NET datasets.

Connecting forms to Web services to receive data

  1. In the Design a Form task pane, click New from Data Connection.
  2. In the Data Connection Wizard, click Web service as the type of data connection.
  3. Select Receive data.
  4. Enter the location of the Web service to connect to.
  5. Select a Web method that the Web service provides for receiving data.
  6. Enter a name or accept the default name for the data connection to be used for receiving data.
  7. Click Finish.

Connecting forms to Web services to receive and submit data

Configuring the Web service

To design a form that connects to a Web service so it can receive data from and submit data to an ADO.NET dataset, first configure a Web service to receive data as described previously in steps 1 through 6 under Connecting forms to Web services to receive data, except select Receive and submit data in step 3. To configure a Web service to submit data:

  1. Enter the location of the Web service to connect to.
  2. Select a Web method that the Web service provides for submitting data.
  3. Specify the fields and groups in the form that will provide the data for any parameters of the submit operation. The dataset group to submit is usually the immediate parent of the (choice) group.
  4. Enter a name or accept the default name for the data connection to be used for submitting data.
  5. Click Finish.

Submitting data

Datasets are serialized using DiffGrams before they are transported over the wire. DiffGrams contain the schema and data of the dataset, and any information regarding changes that have been made to the original copy of the data. When submitting data, Web services use DiffGrams to update the data source with any changes.

When a user edits data, the integrity of the data is maintained according to the following rules. For more information, refer to the documentation for data tables and data columns in the .NET Framework SDK.

  • Relationships

  • Constraints

  • Read-only columns

  • Automatically incremented columns

Connecting forms to Web services to submit data

  1. In the Design a Form task pane, click New from Data Connection.
  2. In the Data Connection Wizard, click Web service as the type of data connection.
  3. Select Submit data.
  4. Enter the location of the Web service to connect to.
  5. Select a Web method that the Web service provides for submitting data.
  6. Enter a name to identify the data connection for submitting data.
  7. Click Finish.

Note the following when setting up a new form that only submits a dataset:

  • The dataset must be typed.
  • All data submitted is inserted as new data in the DiffGram.
  • All data fields in the dataFields subtree are submitted as XML by default.
  • You can change the data connection for a submit operation to submit only a specific dataset node through the Data Connections dialog box.

There are a few limitations on datasets:

  • Only one dataset is allowed when a form is edited.
  • Copying and pasting of nested datasets updates the foreign key to point to the parent values.
  • DeleteRule and UpdateRule properties are not supported.
  • Constraints or relationships cannot be disabled.