Hi all:
I created a Data Connection “UXP” by using the Wizard, the information of
the data connections is as follows:
Note: The data source is a SharePoint List
I want to know how I can get the data of the SharePoint List when I click a
button.
How Can I write the code?
public void Connect_OnClick(DocActionEvent e)
{
//I want to get the data of the SharePoint List by using the “UXP” Data
Connection
}
S.Y.M. Wong-A-Ton - 20 Jan 2006 12:45 GMT
How about the following?
---
thisXDocument.DataObjects["UXP"].Query();
IXMLDOMDocument2 xmlDOM =
(IXMLDOMDocument2)thisXDocument.DataObjects["UXP"].DOM;
/* xmlNamespaces lists all relevant namespaces XPath needs for retrieval.
You can find them by retrieving thisXDocument.DataObjects["UXP"].DOM.xml and
copying all the namespaces listed in this XML string */
string xmlNamespaces =
"xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\"";
xmlDOM.setProperty("SelectionNamespaces", xmlNamespaces);
// Retrieve nodes using XPath
IXMLDOMNodeList nodes = xmlDOM.selectNodes("//dfs:YourUXPXMLNode");
---
S.Y.M. Wong-A-Ton
> Hi all:
>
[quoted text clipped - 17 lines]
> }
>