using HNWD.Pregrant.Common; using System.Data; using System.Data.SqlClient; namespace HNWD.Pregrant.DataAccess { public class ConnectorManager { //private readonly static DbConnection connection = new OleDbConnection(GlobalConfigureSetting.GetConfigureSetting("WD_IPCALL_PREGNANT")); //private readonly static object lockobj = new object(); //public static DbConnection GetDbInstance() //{ // lock (lockobj) // { // if (connection.State == ConnectionState.Closed) // { // connection.Open(); // } // } // return connection; //} //public void Close() //{ // if (connection.State == ConnectionState.Open) // { // connection.Close(); // } //} private readonly static string connStr = GlobalConfigureSetting.GetConfigureSetting("WD_IPCALL_PREGNANT"); public SqlConnection GetInstance() { SqlConnection conn = new SqlConnection(connStr); if (conn.State == ConnectionState.Closed) { conn.Open(); } return conn; } } }