Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.
Namespace: MySql.Data.MySqlClient
Assembly: MySql.Data (in MySql.Data.dll) Version: 6.8.4.0
Syntax
C# |
public override int ConnectionTimeout { get; }
|
Visual Basic |
Public Overrides ReadOnly Property ConnectionTimeout As Integer
Get
|
Visual C++ |
public:
virtual property int ConnectionTimeout {
int get () override;
}
|
Implements
IDbConnection..::..ConnectionTimeout
Remarks
Examples
The following example creates a MySqlConnection
and sets some of its properties in the connection string.
Visual Basic | Copy |
---|
Public Sub CreateSqlConnection()
Dim myConnection As New MySqlConnection()
myConnection.ConnectionString = "Persist Security Info=False;Username=user;Password=pass;database=test1;server=localhost;Connect Timeout=30"
myConnection.Open()
End Sub |
C# | Copy |
---|
public void CreateSqlConnection()
{
MySqlConnection myConnection = new MySqlConnection();
myConnection.ConnectionString = "Persist Security Info=False;Username=user;Password=pass;database=test1;server=localhost;Connect Timeout=30";
myConnection.Open();
} |
Exceptions
See Also