Compartir a través de


EmailSubmitConnection.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 EmailSubmitConnection
Dim input As XPathNavigator

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

Parameters

Exceptions

Exception Condition
ArgumentNullException

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

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 main data source of the form. The XPathNavigator object specified for the input parameter should point to an XML node which contains the data to be submitted. The data to submit can be specified by any DataSource object.

Setting the input parameter to null has the same effect as using the default Execute() method to submit the entire form 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

The following example uses the Execute(XPathNavigator) method to submit the form to the data connection named "Email Submit" using the data from the data source named "QueryTypedDataSet" instead of the main data source of the form.

public void FormEvents_Submit(object sender, SubmitEventArgs e)
{
   XmlForm myXmlForm = this;
   XPathNavigator myNav = myXmlForm.DataSources[
      "QueryTypedDataSet"].CreateNavigator();

   EmailSubmitConnection mySubmit = (EmailSubmitConnection)myXmlForm.
      DataConnections["Email Submit"];
   mySubmit.Execute(myNav);
}
Public Sub FormEvents_Submit(ByVal sender As Object, _
   ByVal e As SubmitEventArgs)
   Dim myXmlForm As XmlForm = Me
   Dim myNav As XPathNavigator = myXmlForm.DataSources(_
      "QueryTypedDataSet").CreateNavigator()

   EmailSubmitConnection mySubmit = DirectCast( _
      myXmlForm.DataConnections("Email Submit"),EmailSubmitConnection)
   mySubmit.Execute(myNav)
End Sub

See Also

Reference

EmailSubmitConnection Class

EmailSubmitConnection Members

Execute Overload

Microsoft.Office.InfoPath Namespace