예제 #1
0
파일: DBDriver.cs 프로젝트: orf53975/Common
        private void init_driver()
        {
            drivers.Clear();
            var xml = new XmlDocument();

            using (var stream = ResourcesHelper.ReadResources <DBDriverProvice>("Setting.driver.xml"))
            {
                xml.Load(stream);
            }
            var root = xml.SelectSingleNode("/Drivers");

            if (root.HasChildNodes)
            {
                foreach (XmlNode item in root.ChildNodes)
                {
                    if (item != null && item.HasChildNodes)
                    {
                        DBDriver driver = new DBDriver();
                        foreach (XmlNode children in item.ChildNodes)
                        {
                            if (children.Name == "ConnectionString")
                            {
                                driver.ConnectionString = children.InnerText;
                            }
                            else if (children.Name == "Description")
                            {
                                driver.Description = children.InnerText;
                            }
                        }
                        drivers.Add(driver);
                    }
                }
            }
        }
예제 #2
0
 private void init_driver()
 {
     drivers.Clear();
     var xml = new XmlDocument();
     using (var stream = ResourcesHelper.ReadResources<DBDriverProvice>("Setting.driver.xml"))
     {
         xml.Load(stream);
     }
     var root = xml.SelectSingleNode("/Drivers");
     if (root.HasChildNodes)
     {
         foreach (XmlNode item in root.ChildNodes)
         {
             if (item != null && item.HasChildNodes)
             {
                 DBDriver driver = new DBDriver();
                 foreach (XmlNode children in item.ChildNodes)
                 {
                     if (children.Name == "ConnectionString")
                     {
                         driver.ConnectionString = children.InnerText;
                     }
                     else if (children.Name == "Description")
                     {
                         driver.Description = children.InnerText;
                     }
                 }
                 drivers.Add(driver);
             }
         }
     }
 }