Applying updates by using a DiffGram with the diffgr
arentID annotation
This example illustrates how the
parentID annotation that is specified in the <
before> block of the DiffGram is used in applying the updates.
Code:
<NewDataSet />
<diffgr:before>
<Order diffgr:id="Order1" msdata:rowOrder="0" OrderID="2" />
<Order diffgr:id="Order3" msdata:rowOrder="2" OrderID="4" />
<OrderDetail diffgr:id="OrderDetail1"
diffgr:parentId="Order1"
msdata:rowOrder="0"
ProductID="13"
OrderID="2" />
<OrderDetail diffgr:id="OrderDetail3"
diffgr:parentId="Order3"
ProductID="77"
OrderID="4"/>
</diffgr:before>
</diffgr:diffgram> This DiffGram specifies a delete operation because there is only a <
before> block. In the DiffGram, the
parentID annotation is used to specify a parent-child relationship between the orders and order details. When SQLXML deletes the records, it deletes records from the child table that is identified by this relationship and then deletes the records from the corresponding parent table.
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!