Exemplo n.º 1
0
        private void GetData()
        {
            string connStr = CommonFuction.GetAppSetting("DBConnectionString");
            Dictionary <string, string> connDic = new Dictionary <string, string>();
            List <string> arrConnStr            = new List <string>();

            arrConnStr.AddRange(connStr.Split(';'));

            foreach (string x in arrConnStr)
            {
                string[] temp = x.Trim().Split('=');
                connDic.Add(temp[0], temp[1]);
            }

            string value = "";

            if (connDic.TryGetValue("Data Source", out value))
            {
                mtxtIP.ucValue = value;
            }
            if (connDic.TryGetValue("initial Catalog", out value))
            {
                mtxtCatalog.ucValue = value;
            }
            if (connDic.TryGetValue("user", out value))
            {
                mtxtID.ucValue = value;
            }
            if (connDic.TryGetValue("password", out value))
            {
                mtxtPW.ucValue = value;
            }
        }