Try OpenEdge Now
skip to main content
Web Services
Developing a .NET Client to Consume OpenEdge SOAP Web Services : Developing the VB.NET client application : Processing schema and data for output TABLE-HANDLE parameter

Processing schema and data for output TABLE-HANDLE parameter

This example shows how you might process the data from an output TABLE-HANDLE parameter by walking the output XML Schema and XML data to create a .NET DataSet and bind the DataSet to a .NET DataGrid:
Dim schemaEl As XmlElement
Dim dataEl As XmlElement
Dim node As XmlNode
Dim type As XmlNodeType

' Extract the schema and data elements from the output
schemaEl = Nothing
dataEl = Nothing

For i = 0 To dynTTEl.ChildNodes.Count - 1
   node = dynTTEl.ChildNodes( i )
   type = node.NodeType
   If type = System.Xml.XmlNodeType.Element Then
      If schemaEl Is Nothing Then
         schemaEl = node
      ElseIf dataEl Is Nothing Then
         dataEl = node
         ‘Too many elements, something is wrong
      End If
   End If
Next i

' Load schema and data into a System.Data.DataSet, then bind to a
‘ System.Windows.Forms.DataGrid
mySchemaReader = New System.Xml.XmlNodeReader(schemaEl)
myDataReader = New System.Xml.XmlNodeReader(dataEl)


' Load myDataGrid with the output from DynTT
myDataGrid.SetDataBinding(myDataSet, "Item")