DiffGram Examples
The examples in this topic consist of DiffGrams that perform insert, update, and delete operations to the database. Before using the examples, note the following:
* The examples use two tables (Cust and Ord) that must be created if you want to test the DiffGram examples:
Code:
Cust(CustomerID, CompanyName, ContactName)
Ord(OrderID, CustomerID)
* Most of the examples in this topic use the following XSD Schema:
Code:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:annotation>
<xsd:documentation>
Diffgram Customers/Orders Schema.
</xsd:documentation>
<xsd:appinfo>
<sql:relationship name="CustomersOrders"
parent="Cust"
parent-key="CustomerID"
child-key="CustomerID"
child="Ord"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:element name="Customer" sql:relation="Cust">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="CompanyName" type="xsd:string"/>
<xsd:element name="ContactName" type="xsd:string"/>
<xsd:element name="Order" sql:relation="Ord" sql:relationship="CustomersOrders">
<xsd:complexType>
<xsd:attribute name="OrderID" type="xsd:int" sql:field="OrderID"/>
<xsd:attribute name="CustomerID" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="CustomerID" type="xsd:string" sql:field="CustomerID"/>
</xsd:complexType>
</xsd:element>
</xsd:schema> Save this schema as DiffGramSchema.xml in the same folder where you save other files used in the examples.
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!