Exemple #1
0
        //Get List DBInfo
        private List <InfoDB> GetDBs(InfoLogin infoLogin)
        {
            List <InfoDB> list          = new List <InfoDB>();
            var           monitoring_db = Properties.Settings.Default.default_monitoring_dbname;
            string        connectString = attConnect[0] + infoLogin.Machine +
                                          attConnect[2] + infoLogin.User +
                                          attConnect[3] + infoLogin.Password;

            using (SqlConnection con = new SqlConnection(connectString))
            {
                con.Open();
                string query = String.Format(
                    @"SELECT s.datasource, ds.[catalog] , d.createdDate, d.brandname, d.domainname, s.[user],s.password
						FROM	[{0}].[dbo].[storage] as s,
								[{0}].[dbo].[domain_storage] as ds,                            
								[{0}].[dbo].[domain] as d
						WHERE S.ID = DS.storageid AND d.ID = ds.domainid AND s.[user] = '{1}'; "                        , monitoring_db, infoLogin.User);
                using (SqlCommand cmd = new SqlCommand(query, con))
                {
                    using (SqlDataReader dbList = cmd.ExecuteReader())
                    {
                        while (dbList.Read())
                        {
                            InfoDB dB = new InfoDB();
                            dB.DataSource   = dbList["datasource"].ToString();
                            dB.Catalog      = dbList["catalog"].ToString();
                            dB.CreatedDate  = dbList["createdDate"].ToString();
                            dB.BrandName    = dbList["brandName"].ToString();
                            dB.DomainName   = dbList["domainName"].ToString();
                            dB.User         = dbList["user"].ToString();
                            dB.Password     = dbList["password"].ToString();
                            dB.UpdateChoice = false;
                            list.Add(dB);
                        }
                    }
                }
            }
            return(list);
        }
Exemple #2
0
 public Result(string stateBackup, InfoDB db)
 {
     this.DB           = db.DataSource;
     this.Catalog      = db.Catalog;
     this.BackupResult = stateBackup;
 }
Exemple #3
0
 //When upgrade success
 public Result(InfoDB db)
 {
     this.DB      = db.DataSource;
     this.Catalog = db.Catalog;
 }