public DataBaseManager(string dbname) { try { #if Release dalfile = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory,"Config","dal.xml"); #endif dalfile =Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory,"Config","dal.xml"); document = new XmlDocument(); document.Load(dalfile); XmlNodeList nodes = document.SelectNodes("//dal//databaseSets//databaseSet"); foreach (XmlNode node in nodes) { if (node.Attributes["name"].Value == dbname) { dataBaseSet = new DataBaseSet(); dataBaseSet.DBItems = new List<DBItem>(); provider = node.Attributes["provider"].Value; dataBaseSet.Provider = provider; XmlNodeList childNodes = node.ChildNodes; DBItem item = null; foreach (XmlNode childNode in childNodes) { item = new DBItem(); item.ConnectString = childNode.Attributes["connectionString"].Value; item.DataBaseType = childNode.Attributes["databaseType"].Value; item.Name = childNode.Attributes["name"].Value; dataBaseSet.DBItems.Add(item); } } } } catch (Exception ex) { throw; } finally { } }
public SqlServerProvider(DataBaseSet dbset) { this.dbset = dbset; }