GBASE南大通用分享
获取或设置连接超时时间,值为‚0‛时没有限制。
语法
[Visual Basic]
Public Overrides ReadOnly Property ConnectionTimeout As Integer
Get
[C#]
public override int ConnectionTimeout { get; }
实现
IDbConnection.ConnectionTimeout
异常
下面的例子演示如何创建一个 GBaseConnection 并设置它的一些属性。
[Visual Basic]
Public Sub CreateConnection()
Dim gsConnection As New GBaseConnection()
gsConnection.ConnectionString = "Persist
SecurityInfo=False;database=gsDB;server=gsHost;Connect
Timeout=30;user id=gsUser; pwd=gsPass;pooling=false"
gsConnection.Open()
End Sub 'CreateConnection
[C#]
public void CreateConnection()
{
GBaseConnection gsConnection = new GBaseConnection();
gsConnection.ConnectionString = "Persist
SecurityInfo=False;database=gsDB;server=gsHost;Connect
Timeout=30;user id=gsUser; pwd=gsPass";
gsConnection.Open();
}
下面的例子创建一个 GBaseConnection 并在连接字符串中设置它的一些属
性。
[Visual Basic]
Public Sub CreateSqlConnection()
Dim gsConnection As New GBaseConnection()
gsConnection.ConnectionString = "Persist Security"_
&"Info=False;Username=user;Password=pass;database=test1; "_
&"server=localhost;Connect Timeout=30;pooling=false "
gsConnection.Open()
End Sub
[C#]
public void CreateSqlConnection()
{
GBaseConnection gsConnection = new GBaseConnection();
gsConnection.ConnectionString = "Persist
SecurityInfo=False;Username=user;
Password=pass;database=test1;server=localhost;Connect
Timeout=30;pooling=false";
gsConnection.Open();
}