WebServiceAdapter2.GenerateDataSetDiffGram(IXMLDOMNode) 方法

定义

获取序列化的 ADO.NET DataSet,其中包含用于描述数据和 DataSet 的 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

参数

pNode
IXMLDOMNode

一个 XML 文档对象模型 (DOM) 节点,其中包含将创建其 DiffGram 的 DataSet 的 XML 数据。

返回

一个 XML DOM 节点,其中包含 XML DataSet。

示例

在以下示例中,的 GenerateDataSetDiffGram 方法 WebServiceAdapterObject 用于在消息框中显示 DataSet“i0:dataset”的 DiffGram XML:

// 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);

注解

输入pNode的 DataSet DiffGram 是使用同级节点originalData生成的,用于计算 和 输入 pNode之间的差异originalData

适用于