FileSubmitConnection.Execute Method (XPathNavigator) (Microsoft.Office.InfoPath)

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

  • input
    An XPathNavigator that is positioned at the XML node of the form that contains the data to submit.

Exceptions

Exception type Condition

WebException

The submit operation failed.

ArgumentNullException

The parameter passed to this method is null.

ArgumentException

The parameter passed to this method isnot 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 null 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 Office InfoPath 2007 or in a Web browser.

Example

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
Microsoft.Office.InfoPath Namespace