Exemplo n.º 1
0
        public override IList <DataBaseEntity> GetDataBases(ServiceSite site)
        {
            IList <DataBaseEntity> list = null;

            using (MySqlConnection connection = new MySqlConnection(site.DbConnectionStringBuilder.ConnectionString))
            {
                connection.Open();
                DataTable databases = connection.GetSchema(SqlClientMetaDataCollectionNames.Databases, new string[] { null });
                if (databases != null && databases.Rows.Count > 0)
                {
                    list = new List <DataBaseEntity>();
                    foreach (DataRow database in databases.Rows)
                    {
                        string name = (string)database["database_name"];
                        MySqlConnectionStringBuilder con = new MySqlConnectionStringBuilder(site.DbConnectionStringBuilder.ConnectionString);
                        con.Database = name;
                        DataBaseEntity db = new DataBaseEntity(con, name);
                        db.Service = site;
                        list.Add(db);
                    }
                }
            }
            return(list);
        }
Exemplo n.º 2
0
 public static ServiceSite NewInstance(DbConnectionStringBuilder connectionstringbuilder, string service)
 {
     site = new ServiceSite(connectionstringbuilder, service);
     return(site);
 }
Exemplo n.º 3
0
 public abstract IList <DataBaseEntity> GetDataBases(ServiceSite site);
Exemplo n.º 4
0
 public override IList<DataBaseEntity> GetDataBases(ServiceSite site)
 {
     IList<DataBaseEntity> list = null;
     using (MySqlConnection connection = new MySqlConnection(site.DbConnectionStringBuilder.ConnectionString))
     {
         connection.Open();
         DataTable databases = connection.GetSchema(SqlClientMetaDataCollectionNames.Databases, new string[] { null });
         if (databases != null && databases.Rows.Count > 0)
         {
             list = new List<DataBaseEntity>();
             foreach (DataRow database in databases.Rows)
             {
                 string name = (string)database["database_name"];
                 MySqlConnectionStringBuilder con = new MySqlConnectionStringBuilder(site.DbConnectionStringBuilder.ConnectionString);
                 con.Database = name;
                 DataBaseEntity db = new DataBaseEntity(con,name);
                 db.Service = site;
                 list.Add(db);
             }
         }
     }
     return list;
 }
Exemplo n.º 5
0
 public abstract IList<DataBaseEntity> GetDataBases(ServiceSite site);
Exemplo n.º 6
0
 public static ServiceSite NewInstance(DbConnectionStringBuilder connectionstringbuilder, string service)
 {
     site = new ServiceSite(connectionstringbuilder, service);
     return site;
 }