Edit

Share via


FileQueryConnection Class

Definition

Represents a connection for retrieving data from an XML file.

public ref class FileQueryConnection abstract : Microsoft::Office::InfoPath::DataConnection
public abstract class FileQueryConnection : Microsoft.Office.InfoPath.DataConnection
type FileQueryConnection = class
    inherit DataConnection
Public MustInherit Class FileQueryConnection
Inherits DataConnection
Inheritance
FileQueryConnection

Remarks

The FileQueryConnection class represents a data connection created in InfoPath using the Data Connection Wizard that specifies all the information necessary for retrieving data from an XML file that is used as a secondary (external) data source.

The FileQueryConnection object is accessible using the DataConnections property of the XmlForm class to return the connection from the DataConnectionCollection of the form template.

The FileQueryConnection object can also be accessed from DataSourceCollection of the form template using the DataSources property of the XmlForm, and the QueryConnection property of the DataSource class as shown in the following line of code.

FileQueryConnection myDataSource = 
   (FileQueryConnection)(DataSources["XMLFile"].QueryConnection);
Dim myDataSource As FileQueryConnection  = 
   DirectCast(DataSources("XMLFile").QueryConnection, _
   FileQueryConnection)

The FileQueryConnection class provides the FileLocation property, which can be used get or set the Uniform Resource Locator (URL) or universal naming convention (UNC) path of the XML file that is being used an external data source.

In addition to the default Execute() method inherited from the DataConnection base class that performs a query operation using the values that were declaratively defined in InfoPath form template design mode, the FileQueryConnection class also provides the Execute(XPathNavigator) method, which allows you to specify a different XML node in which to insert the data returned from the external XML file.

The FileQueryConnection class corresponds to the XMLFileAdapterObject class of the Microsoft Office InfoPath 2003 object model.

Constructors

FileQueryConnection()

Properties

FileLocation

Gets or sets the Uniform Resource Locator (URL) or universal naming convention (UNC) path of the XML file that is associated with the FileQueryConnection object.

Name

Gets the name of the data connection.

(Inherited from DataConnection)

Methods

Execute()

Depending on which ConnectionTypeConnection class it is called from, executes a submit or query operation on the data connection using the declaratively defined values for the submitted data, query parameters, or data to retrieve.

(Inherited from DataConnection)
Execute(XPathNavigator)

Overrides the default Execute() method to allow specifying a different location to insert the data that is returned.

Applies to