init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,61 @@
|
|||
using System;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace SDA.DataProvider.Wrappers.MSSQL
|
||||
{
|
||||
internal class MSSQLConnectionStringBuilderWrapper : IDisposable
|
||||
{
|
||||
SqlConnectionStringBuilder builder;
|
||||
|
||||
public MSSQLConnectionStringBuilderWrapper(string connectionstring)
|
||||
{
|
||||
builder = new SqlConnectionStringBuilder(connectionstring);
|
||||
|
||||
GenerateConnectionString();
|
||||
}
|
||||
|
||||
public string ConnectionString
|
||||
{
|
||||
get
|
||||
{
|
||||
return builder.ConnectionString;
|
||||
}
|
||||
set
|
||||
{
|
||||
builder.ConnectionString = value;
|
||||
|
||||
GenerateConnectionString();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ha megvan adva ConnectionTimeout a konfigban, akkor felülírja a connection stringet
|
||||
/// </summary>
|
||||
void GenerateConnectionString()
|
||||
{
|
||||
if (Configuration.ConnectionTimeout.HasValue
|
||||
&& builder.ConnectionString.IndexOf("Connect Timeout", StringComparison.OrdinalIgnoreCase) == -1)
|
||||
{
|
||||
ConnectionTimeout = Configuration.ConnectionTimeout.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
builder = null;
|
||||
}
|
||||
|
||||
public int ConnectionTimeout
|
||||
{
|
||||
get
|
||||
{
|
||||
return builder.ConnectTimeout;
|
||||
}
|
||||
set
|
||||
{
|
||||
builder.ConnectTimeout = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue