Creating .NET DataSets from ProDataSet parameters
- Last Updated: December 6, 2022
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
This section presents an example of how to create an .NET DataSet from a ProDataSet parameter. Because .NET has a proprietary method of recognizing and exposing .NET DataSets in WSDL documents, its toolkit cannot translate the WSDL definition of a ProDataSet directly into an .NET DataSet. To work around this limitation, a .NET client can walk the object arrays and populate a .NET DataSet with the data.
The following table describes the specifications for the sample Web service and interface used in this section.
| Property or component | Value or name | Object type |
|---|---|---|
| Web service |
CustOrdersService
|
– |
| URL |
http://servicehost:80/wsa/wsa1
|
– |
| Session model | Session-Free | – |
| TargetNamespace |
urn:CustOrders
|
– |
| WSDL objects |
CustOrdersObj
|
AppObject |
dsCustOrd
|
ProDataSet dsCustOrd |
In general, the other information presented in the previous example for creating a client interface and developing a client application applies here as well. Except where the differences in the client language and session model affect things, you would complete the same tasks to build this sample.
This Web service uses the following code to create and populate a static ProDataSet parameter:
|
The Web service accepts an input array to specify a range of customer numbers. The service
then outputs the data in the dsCustOrd ProDataSet.
When you add a Web Reference to the CustOrdersService Web service in
Microsoft Visual Studio, the proxies in the Reference.cs file include
this method to invoke the getCustOrders operation:
|
The Reference.cs file also includes the following partial classes to describe the ProDataSet and its constituent temp-tables:
|
To access the Web service, you might build an interface like the following one:

The combo-boxes enable you to set the range of customer numbers for the input parameter. When you click the button, the client calls the Web service, retrieves the data for the specified range, and then displays it in the grid.
As shown in the following code, the button's event logic invokes the Web service passing in the array for the CustNum range and retrieves the requested data:
|
Since you know the schema of the incoming DATASET parameter, the event logic
can create a matching .NET DataSet to accept the incoming data, as follows:
|
Finally, the event logic fills the DataSet with the data from the incoming
DATASET parameter and binds the DataSet to a grid, as follows:
|