FileSubmitConnection.Execute(XPathNavigator) 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.
Overrides the default Execute() method to allow specifying a different source of data to submit.
public:
abstract void Execute(System::Xml::XPath::XPathNavigator ^ input);
public abstract void Execute (System.Xml.XPath.XPathNavigator input);
override this.Execute : System.Xml.XPath.XPathNavigator -> unit
Public MustOverride Sub Execute (input As XPathNavigator)
Parameters
- input
- XPathNavigator
An XPathNavigator that is positioned at the XML node of the form that contains the data to submit.
Exceptions
The submit operation failed.
The parameter passed to this method is a null reference (Nothing in Visual Basic).
The parameter passed to this method is not valid. For example, it is of the wrong type or format.
Examples
In the following example, the Execute(input
) method is used to perform a submit operation to the SharePoint Library defined by FileSubmitConnection object to submit the contents of the UniqueValue node in the main data source of the form.
public void ExecuteInput_Clicked(object sender, ClickedEventArgs e)
{
string UniqueValueXPath = "/my:myFields/my:UniqueValue";
XPathNavigator mainNavigator = MainDataSource.CreateNavigator();
XPathNavigator uniqueValueNavigator =
mainNavigator.SelectSingleNode(UniqueValueXPath,
NamespaceManager);
FileSubmitConnection submitConnection =
(FileSubmitConnection)(DataConnections["SharePoint Library"]);
submitConnection.Execute(uniqueValueNavigator);
}
Public Sub ExecuteInput_Clicked(ByVal sender As Object, _
ByVal e As ClickedEventArgs)
Dim UniqueValueXPath As String = "/my:myFields/my:UniqueValue"
Dim mainNavigator As XPathNavigator =
MainDataSource.CreateNavigator()
Dim uniqueValueNavigator As XPathNavigator =
mainNavigator.SelectSingleNode(UniqueValueXPath,
NamespaceManager)
Dim submitConnection As FileSubmitConnection =
DirectCast(DataConnections["SharePoint Library"], _
FileSubmitConnection)
submitConnection.Execute(uniqueValueNavigator)
End Sub
Remarks
This method overrides the default Execute method (inherited from the DataConnection base class), which submits the data that is declaratively defined in the form template. The XPathNavigator object specified for the input
parameter should point to an XML element which contains the data to be submitted. The data to submit can be in specified by any DataSource object.
Setting the input
parameter to a null reference (Nothing in Visual Basic) has the same effect as using the default Execute method to submit data using the declarative settings defined in the form template.
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.
This type or member can be accessed from code running in forms opened in Microsoft InfoPath Filler or in a Web browser.