Try OpenEdge Now
skip to main content
.NET Open Clients
Passing Parameters : Passing DATASET and DATASET-HANDLE parameters : ProDataSet examples : Sample static ProDataSet
 
Sample static ProDataSet
The following example shows a static ProDataSet definition in a persistent procedure, CustomersAndOrders.p.
Static ProDataSet in a persistent procedure
DEFINE TEMP-TABLE OrderInfo
  FIELD order-date AS DATE
  FIELD quantity   AS INTEGER.

DEFINE TEMP-TABLE CustomerInfo
  FIELD cust-name AS CHARACTER
  FIELD address   AS CHARACTER.

DEFINE DATASET OrderDS for OrderInfo, CustomerInfo.

PROCEDURE getOrders:
  DEFINE OUTPUT PARAMETER DATASET FOR OrderDS.
For this parameter, ProxyGen generates the following:
*OrderDS.cs with the following class definition:
Acme.StrongTypesNS.OrderDSDataSet
*The following method in the proxy:
public void getOrders(out Acme.StrongTypesNS.OrderDSDataSet orderDS)
The following example shows a static ProDataSet definition in an external procedure, SetCustomersAndOrders.p.
Static ProDataSet in a procedure
DEFINE TEMP-TABLE OrderInfo
  FIELD order-date AS DATE
  FIELD quantity   AS INTEGER.

DEFINE TEMP-TABLE CustomerInfo
  FIELD cust-name AS CHARACTER
  FIELD address   AS CHARACTER.

DEFINE DATASET MySetOrderDS FOR OrderInfo, CustomerInfo.

DEFINE INPUT PARAMETER DATASET FOR MySetOrderDS.
Since the schema for these two static DataSet parameters is the same, ProxyGen uses the previously generated, strongly typed DataSet in the proxy method generated for this external procedure. For example:
public void SetCustomersAndOrders(Acme.StrongTypesNS.OrderDSDataSet mySetOrderDS)
For INPUT and INPUT-OUTPUT parameters, the .NET client code must supply an instance of the strongly typed DataSet object. For OUTPUT parameters, the strongly typed DataSet variable must be declared, but the instance is created by ABL and returned to the .NET client as a parameter.