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"; }
//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); }