Ejemplo n.º 1
0
        public static object GetSingleResult(string sql, string configDbName)
        {
            connSYS = StringSecurity.DESDecrypt(ConfigurationManager.ConnectionStrings[configDbName].ToString());
            SqlConnection conn = new SqlConnection(connSYS);

            return(ExecuteScalar(conn, new SqlCommand(sql, conn)));
        }
Ejemplo n.º 2
0
        static OracleConnection OpenConn()
        {
            OracleConnection conn = new OracleConnection(StringSecurity.DESDecrypt(ConfigurationManager.ConnectionStrings["bobcatConn"].ToString()));

            //conn.ConnectionString = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.0.33)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)));Persist Security Info=True;User ID=aio;Password=aio123456;Pooling=True;Max Pool Size=10;Min Pool Size=1";
            conn.Open();
            return(conn);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 加解密字符串设定
 /// </summary>
 /// <returns></returns>
 public static string GetStringSecurity()
 {
     //connstring = StringSecurity.DESEncrypt(connstring);
     connstring = StringSecurity.DESDecrypt(connstring);
     return(connstring);
 }