FileQueryConnection class

Represents a connection for retrieving data from an XML file.

Inheritance hierarchy

System.Object
  Microsoft.Office.InfoPath.DataConnection
    Microsoft.Office.InfoPath.FileQueryConnection

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

Syntax

'Declaration
Public MustInherit Class FileQueryConnection _
    Inherits DataConnection
'Usage
Dim instance As FileQueryConnection
public abstract class FileQueryConnection : DataConnection

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 FileQueryConnection.Execute 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.

Thread safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See also

Reference

FileQueryConnection members

Microsoft.Office.InfoPath namespace