Accessing the Forms2RecordDataSet Data Using XMLDocument

Applies to: SharePoint Workspace 2010 | Visual Studio 2008

You can parse the Forms2RecordDataSet Data using XMLDocument as an alternative to converting the Forms2RecordDataSet to an ADO .NET DataSet. You can use this simpler mechanism when you are accessing a limited set of system fields or only accessing records from tools with a known schema. Because the Data section does not contain any type information, you can only use this mechanism when your code is aware of the type of each field or can treat each field as a string value and ignore the type. In the following use cases, although you could perform the task after converting the Forms2RecordDataSet to a .NET DataSet, you may choose to use XMLDocument to directly access the Data element.

In the Forms2RecordDataSet, the _ParentID system field identifies the parent record by its _RecordID value. If you convert a Forms2RecordDataSet to a .NET DataSet, the parent-child relationship is not maintained and the _RecordID column is not a primary key in the table. It is possible to determine the parent of a record by searching for the record whose _RecordID value matches its _ParentID value. But if the Forms tool has multiple forms, it may be necessary to search through multiple tables in the .NET DataSet to find the parent record.

When you read records using QueryRecords or ReadRecords, if a record has a parent record and both child and parent are included in the Data element, the parent record will always precede the child record, but the Data may contain a child record and not contain the parent record. Because the parent-child order is known and because all types of records are included in the Data XMLDocument, it may be more convenient to determine the parent-child relationship using the Data XDocument than performing this task in a converted .NET DataSet.

In This Section

Example Code: Using XMLDocument to Discover Hierarchy

See Also

Concepts

Accessing Forms Tool Records

Using ADO.NET DataSets to Access Forms2RecordDataSet Data