using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace Web25175.DBHelper
{
    public class DBManager
    {
        //连接字符串
        public static readonly string myConnStr = ConfigurationManager.AppSettings["ConnectionString"];
        //默认　System.Data.SqlClient
        public static readonly string dbProviderName = string.IsNullOrEmpty(ConfigurationManager.AppSettings["dbProviderName"])
                                                    ? "System.Data.SqlClient" : ConfigurationManager.AppSettings["dbProviderName"];
        [ThreadStatic]
        static DBHelper helper;
        public static DBHelper Instance()
        {
            if (helper == null)
            {
                helper = new DBHelper(myConnStr, dbProviderName);
                return helper;
            }
            return helper;
        }
    }
}
