Ejemplo n.º 1
0
        public ICollection <DataBase> List()
        {
            Table tb = new Table();
            ICollection <DataBase> coleccion = null;
            Connection             c         = new MysqlConecction();
            IDbConnection          cnn       = c.Open();

            try
            {
                var registro = SqlMapper.Query <DataBase>(cnn, "Server_GetDatabases", null, commandType: CommandType.StoredProcedure);
                coleccion = (ICollection <DataBase>)registro;
                foreach (var item in coleccion)
                {
                    item.tables = tb.GetAll(item.name);
                }
            }
            catch (Exception e)
            {
            }
            finally
            {
                c.Close(cnn);
            }
            return(coleccion);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get name_column and data_type
        /// </summary>
        /// <param name="db"></param>
        /// <param name="table"></param>
        private void GetColumn(string db, string table)
        {
            Connection    c   = new MysqlConecction();
            IDbConnection cnn = c.Open();

            try
            {
                var registro = SqlMapper.Query <Element>(cnn, "Server_GetColumn", new { db = db, tb = table }, commandType: CommandType.StoredProcedure);
                column     = new Queue <Element>(registro);
                columnBack = (List <Element>)registro;
            }
            catch (Exception e)
            {
            }
            finally
            {
                c.Close(cnn);
            }
        }
Ejemplo n.º 3
0
 public ICollection<DataBase> List()
 {
     Table tb = new Table();
     ICollection<DataBase> coleccion= null;
     Connection c = new MysqlConecction();
     IDbConnection cnn = c.Open();
     try
     {
         var registro = SqlMapper.Query<DataBase>(cnn, "Server_GetDatabases", null, commandType: CommandType.StoredProcedure);
         coleccion = (ICollection<DataBase>)registro;
         foreach (var item in coleccion)
         {
             item.tables = tb.GetAll(item.name);
         }
     }
     catch (Exception e)
     {
     }
     finally
     {
         c.Close(cnn);
     }
     return coleccion;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Get name_column and data_type
 /// </summary>
 /// <param name="db"></param>
 /// <param name="table"></param>
 private void GetColumn(string db, string table)
 {
     Connection c = new MysqlConecction();
     IDbConnection cnn = c.Open();
     try
     {
         var registro = SqlMapper.Query<Element>(cnn, "Server_GetColumn", new { db = db, tb = table}, commandType: CommandType.StoredProcedure);
         column = new Queue<Element>(registro);
         columnBack = (List<Element>)registro;
     }
     catch (Exception e)
     {
     }
     finally
     {
         c.Close(cnn);
     }
 }