Share via


FileSubmitConnection.Execute Method (XPathNavigator)

Overrides the default Execute method to allow specifying a different source of data to submit.

Namespace:  Microsoft.Office.InfoPath
Assembly:  Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)

Syntax

'Declaration
Public MustOverride Sub Execute ( _
    input As XPathNavigator _
)
'Usage
Dim instance As FileSubmitConnection
Dim input As XPathNavigator

instance.Execute(input)
public abstract void Execute(
    XPathNavigator input
)

Parameters

Exceptions

Exception Condition
WebException

The submit operation failed.

ArgumentNullException

The parameter passed to this method is a null reference (Nothing in Visual Basic).

ArgumentException

The parameter passed to this method is not valid. For example, it is of the wrong type or format.

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.

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

See Also

Reference

FileSubmitConnection Class

FileSubmitConnection Members

Execute Overload

Microsoft.Office.InfoPath Namespace