WebServiceAdapter2.GenerateDataSetDiffGram method
Gets a serialized ADO.NET DataSet, containing an inline schema describing the data and the DataSet's DiffGram.
Namespace: Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)
Syntax
'Declaration
Function GenerateDataSetDiffGram ( _
pNode As IXMLDOMNode _
) As IXMLDOMNode
'Usage
Dim instance As WebServiceAdapter2
Dim pNode As IXMLDOMNode
Dim returnValue As IXMLDOMNode
returnValue = instance.GenerateDataSetDiffGram(pNode)
IXMLDOMNode GenerateDataSetDiffGram(
IXMLDOMNode pNode
)
Parameters
pNode
Type: Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNodeAn XML Document Object Model (DOM) node that contains the XML data of the DataSet whose DataSet DiffGram will be created.
Return value
Type: Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode
An XML DOM node that contains the XML DataSet.
Remarks
The DataSet DiffGram for the input pNode is generated using the sibling node originalData to compute the difference between the originalData and the input pNode.
Important
This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.
Examples
In the following example, the GenerateDataSetDiffGram method of the WebServiceAdapterObject is used to display the DiffGram XML of the DataSet "i0:dataset" in a message box:
// Get the DataSet node from the main data source
const string DataSetNodeName = "i0:dataset";
IXMLDOMNode datasetNode = thisXDocument.DOM.selectSingleNode("//" + DataSetNodeName);
if (datasetNode == null)
{
thisXDocument.UI.Alert("Could not find the DataSet node to generate a DiffGram: " + DataSetNodeName + ".");
return;
}
// Get the Main Data Source WebServiceAdapter object
WebServiceAdapter2 mainAdapter = thisXDocument.QueryAdapter as WebServiceAdapter2;
if (mainAdapter == null)
{
thisXDocument.UI.Alert("Main WebServiceAdapter does not exist.");
return;
}
// Create the DataSet DiffGram
IXMLDOMNode datasetDiffgramNode = mainAdapter.GenerateDataSetDiffGram(datasetNode);
if (datasetDiffgramNode == null)
{
thisXDocument.UI.Alert("Failed to convert " + DataSetNodeName + " to a DataSet DiffGram.");
return;
}
// Show the xml for the DiffGram
thisXDocument.UI.Alert(datasetDiffgramNode.xml);