Exemplo n.º 1
0
        public static object getdbConn(NpgsqlConnection conn, string pmm)
        {
            string connStr; string pmmType;

            connStr = ""; pmmType = "";

            try
            {
                NpgsqlCommand comm;

                comm = new NpgsqlCommand("SELECT connString, PMMSType From iqtools.aa_Database WHERE DbName = '" + pmm + "'", conn);
                NpgsqlDataReader sDR = comm.ExecuteReader();
                while (sDR.Read())
                {
                    connStr = ClsUtility.Decrypt(sDR[0].ToString());
                    pmmType = sDR[1].ToString();
                    break;
                }
            }
            catch (Exception ex)
            {
                connStr = ex.Message;
                connStr = "";
            }

            return(GetConnection(connStr, pmmType));
        }
Exemplo n.º 2
0
        public static string getconnString(string xmlPath)
        {
            XmlDocument theXML = new XmlDocument();

            theXML.Load(xmlPath);
            XmlNode nd = theXML.SelectSingleNode("//add[@key='IQToolconstr']"); //get the node with an attribute of “key” =  IQToolconstr

            if (nd != null)
            {
                return(ClsUtility.Decrypt(nd.Attributes["value"].Value)); //return the value of the value attribute of this node
            }
            return("");
        }
Exemplo n.º 3
0
        public static string GetEMRConnString()
        {
            string versionDependent   = Application.UserAppDataRegistry.Name;
            string versionIndependent = versionDependent.Substring(0, versionDependent.LastIndexOf("\\"));

            string ConnectionString = String.Empty;

            if (Registry.GetValue(versionIndependent, "EMRConnectionString", null) != null)
            {
                return(ClsUtility.Decrypt(Registry.GetValue(versionIndependent, "EMRConnectionString", null).ToString()));
            }
            else
            {
                return(ConnectionString);
            }
        }
Exemplo n.º 4
0
        public static object getdbConn(SqlConnection conn, String pmm)
        {
            string connStr;  string pmmType;

            connStr = ""; pmmType = "";

            try
            {
                SqlCommand comm;
                if (pmm == "msaccess")
                {
                    comm = new SqlCommand("SELECT connString, PMMSType From aa_database WHERE DbName = '" + "IQTools" + "'", conn);
                }
                else
                {
                    comm = new SqlCommand("SELECT connString, PMMSType From aa_database WHERE DbName = '" + pmm + "'", conn);
                }
                SqlDataReader sDR = comm.ExecuteReader();
                while (sDR.Read())
                {
                    connStr = ClsUtility.Decrypt(sDR[0].ToString());
                    if (pmm == "msaccess")
                    {
                        pmmType = "msaccess";
                    }
                    else
                    {
                        pmmType = sDR[1].ToString();
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                connStr = ex.Message;
                connStr = "";
            }

            return(GetConnection(connStr, pmmType));
        }
Exemplo n.º 5
0
        public static string getdbConnString(SqlConnection conn, String pmm)
        {
            string connStr;

            connStr = "";

            try
            {
                SqlCommand    comm = new SqlCommand("SELECT connString From aa_database WHERE DbName = '" + pmm + "'", conn);
                SqlDataReader sDR  = comm.ExecuteReader();
                while (sDR.Read())
                {
                    connStr = ClsUtility.Decrypt(sDR[0].ToString()); //+ "Allow User Variables=True";
                    break;
                }
            }
            catch (Exception ex)
            {
                connStr = ex.Message;
                connStr = "";
            }
            return(connStr);
        }