AdoQueryConnection.Timeout Property
Gets or sets the timeout value in seconds for a data connection associated with an AdoQueryConnection object.
Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)
Syntax
'Declaration
Public MustOverride Property Timeout As Integer
Get
Set
'Usage
Dim instance As AdoQueryConnection
Dim value As Integer
value = instance.Timeout
instance.Timeout = value
public abstract int Timeout { get; set; }
Property Value
Type: System.Int32
The timeout value in seconds.
Remarks
The Timeout property of the ADOQueryConnection class contains the timeout value that is used by the ADO data connection to regulate the time used to retrieve data from an ActiveX Data Objects/OLEDB external data source.
The Timeout property specifies the timeout value in seconds. For a form opened in the Microsoft InfoPath 2010 application, by default this setting is 30 seconds, and the value specified for the Timeout property will override this setting. For a browser-enabled form deployed to InfoPath Forms Services, the default timeout value is set by the administrator. If you set the value of the Timeout property to a value greater than the timeout value set by the administrator, the value set by the administrator will be used instead.
Note
The ADOQueryConnection object is limited to work only with Microsoft SQL Server and Microsoft Access databases.
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 event handler for a Button control uses the Timeout property of the ADOQueryConnection class, which is used to display the timeout value.
public void DisplayTimeout_Clicked(object sender, ClickedEventArgs e)
{
// Get the Employees connection from the
// DataConnections collection.
AdoQueryConnection myAdoQueryConnection =
(AdoQueryConnection)(this.DataConnections["Employees"]);
// Display Timeout value.
MessageBox.Show (myAdoQueryConnection.Timeout.ToString());
}
Public Sub DisplayTimeout_Clicked(ByVal sender As Object, _
ByVal e As ClickedEventArgs)
' Get the Employees connection from
' the DataConnections collection.
Dim myAdoQueryConnection As AdoQueryConnection = _
DirectCast(Me.DataConnections("Employees"), AdoQueryConnection)
' Display Timeout value.
MessageBox.Show (myAdoQueryConnection.Timeout.ToString())
End Sub