WebServiceAdapter2.GenerateDataSetDiffGram(IXMLDOMNode) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a serialized ADO.NET DataSet, containing an inline schema describing the data and the DataSet's DiffGram.
public:
Microsoft::Office::Interop::InfoPath::Xml::IXMLDOMNode ^ GenerateDataSetDiffGram(Microsoft::Office::Interop::InfoPath::Xml::IXMLDOMNode ^ pNode);
public Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode GenerateDataSetDiffGram (Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode pNode);
abstract member GenerateDataSetDiffGram : Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode -> Microsoft.Office.Interop.InfoPath.Xml.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
.