@ -15,10 +15,13 @@ namespace MainApp
private string connString ;
private string connString ;
private SqlConnection conn ;
private SqlConnection conn ;
private const int MIN_POOL_SIZE = 2 0 ;
private const int MAX_POOL_SIZE = 1 0 0 ;
private const int TIMEOUT = 1 5 ; // sec
public bool SetConnection ( string server , string database , string uid , string password )
public bool SetConnection ( string server , string database , string uid , string password )
{
{
connString = $"server={server}; database={database}; uid={uid}; pwd={password};" ;
connString = $"server={server}; database={database}; uid={uid}; pwd={password}; min pool size = {MIN_POOL_SIZE}; max pool size = {MAX_POOL_SIZE}; connection timeout = {TIMEOUT}; " ;
using ( conn = new SqlConnection ( connString ) )
using ( conn = new SqlConnection ( connString ) )
{
{