123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- 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;
- }
- }
- }
|