Example #1
0
        private void ReadConfigConnections(XmlDocument doc)
        {
            XmlNodeList nodes = doc.SelectNodes("/updatesp/connection");
            if (nodes.Count == 0)
            {
                throw new Exception("Unable to read database configuration: can't find any /updatesp/connection nodes");
            }

            foreach (XmlNode node in nodes)
            {
                ConfigConnection conn = new ConfigConnection();

                conn.name = node.SelectSingleNode("name").InnerText;
                conn.server = node.SelectSingleNode("server").InnerText;
                conn.username = node.SelectSingleNode("username").InnerText;
                conn.pw = node.SelectSingleNode("pw").InnerText;

                conn.TestConnection();

                _configConnections.Add(conn.name, conn);
            }
        }