示例#1
0
        public static Database Conn()
        {
            //string ConnString = ConfigurationManager.ConnectionStrings["LocalDatabase"].ToString();
            //string ConnString = decodeSTROnUrl(ConfigurationManager.ConnectionStrings["LocalDatabase"].ToString());
            //ConnString = CryptoGraphy.Decrypt(ConfigurationManager.ConnectionStrings["LocalDatabase"].ToString());
            Database db = new GenericDatabase(CryptoGraphy.Decrypt(ConfigurationManager.ConnectionStrings["LocalDatabase"].ToString()), DbProviderFactories.GetFactory(DecryptConnection.Provider));

            return(db);
        }
 static DecryptConnection()
 {
     ConnectionString = CryptoGraphy.Decrypt(ConfigurationManager.ConnectionStrings["LocalDatabase"].ToString());
     ConnectionString = ConfigurationManager.ConnectionStrings["LocalDatabase"].ToString();
     Provider         = "System.Data.SqlClient";
 }
示例#3
0
        //public static string decodeSTROnUrl(string thisDecode)
        //{
        //    return HttpUtility.UrlDecode(thisDecode);
        //}
        public static SqlDatabase xmlConn()
        {
            SqlDatabase db = new SqlDatabase(CryptoGraphy.Decrypt(ConfigurationManager.ConnectionStrings["LocalDatabase"].ToString()));

            return(db);
        }