XMLConstraints Property

Visual Studio .NET 2003

Contains an object reference to the ISchemaItemCollection object after the successful execution of the XMLAdapter LoadXML or Attach method.

If the LoadXML and Attach methods analyze the XML schema, they set XMLConstraints to the appropriate value, although Visual FoxPro neither analyzes nor enforces any constraints declared in the XMLConstraints collection.


Property Values

Object reference. XMLConstraints contains an object reference to the ISchemaItemCollection object or a null value (.NULL.) when not populated.


XML schema can contain constraints, which are associated with the schema. XMLConstraints provides you with access to constraints defined within the DataSet element.

Visual FoxPro does not include any functionality in XMLAdapter that uses these constraints, but it provides access so that you can obtain constraints information and use them in your application if needed.

In the following XML example, note the location of the Primary Key constraint:

<?xml version="1.0" encoding="Windows-1252"?>
<DataSet xmlns="http://tempuri.org/">
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true">
      <xs:choice maxOccurs="unbounded">
         <xs:element name="Tbl2">
                  <xs:element name="source"/>
                  <xs:element name="num" type="xs:int"/>
                  <xs:element name="xdtime" type="xs:dateTime"/>
                  <xs:element name="xlog" type="xs:boolean"/>
   <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//Tbl2"/>
      <xs:field xpath="source"/>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet xmlns="">
   <Tbl2 diffgr:id="Tbl21" msdata:rowOrder="0">
      <source>Buckner             </source>

See Also

Properties | XMLAdapter Object Properties, Methods, and Events | XMLTable Object Properties, Methods, and Events | LoadXML Method | Attach Method

Applies To: XMLAdapter Class | XMLTable Class