Edit

Share via


WebServiceAdapter2.GenerateDataSetDiffGram(IXMLDOMNode) Method

Definition

Gets a serialized ADO.NET DataSet, containing an inline schema describing the data and the DataSet's DiffGram.

public:
 Microsoft::Office::Interop::InfoPath::SemiTrust::IXMLDOMNode ^ GenerateDataSetDiffGram(Microsoft::Office::Interop::InfoPath::SemiTrust::IXMLDOMNode ^ pNode);
public Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode GenerateDataSetDiffGram (Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode pNode);
abstract member GenerateDataSetDiffGram : Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode -> Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode
Public Function GenerateDataSetDiffGram (pNode As IXMLDOMNode) As IXMLDOMNode

Parameters

pNode
IXMLDOMNode

An XML Document Object Model (DOM) node that contains the XML data of the DataSet whose DataSet DiffGram will be created.

Returns

An XML DOM node that contains the XML DataSet.

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.<span class="label">GenerateDataSetDiffGram</span>(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);

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.

Applies to