Example #1
0
        protected TableSchemaExtend GetViewSchemaFromRow(DataRow row)
        {
            TableSchemaExtend schema = new TableSchemaExtend
            {
                Name = row[TableOfName] as String
            };

            return(schema);
        }
Example #2
0
        protected TableSchemaExtend GetTableSchemaFromRow(DataRow row)
        {
            TableSchemaExtend schema = new TableSchemaExtend
            {
                Explain = row[TableOfComment] as String,
                Name    = row[TableOfName] as String,
            };

            return(schema);
        }
Example #3
0
        public IList <TableSchemaExtend> LoadViewSchemaList()
        {
            List <TableSchemaExtend> viewSchemas = new List <TableSchemaExtend>();
            DataTable info = this._connection.GetSchema("Views", new String[] { null, this.GetDataBaseName(), null, null });

            if (info.Rows.Count > 0)
            {
                foreach (DataRow row in info.Rows)
                {
                    TableSchemaExtend schema = this.GetViewSchemaFromRow(row);
                    viewSchemas.Add(schema);
                }
            }
            return(viewSchemas);
        }
Example #4
0
        public IList <TableSchemaExtend> LoadTableSchemaList()
        {
            List <TableSchemaExtend> tableSchemas = new List <TableSchemaExtend>();
            DataTable info = this.ExecuteQuery(SQLForTableSchema);

            if (info.Rows.Count > 0)
            {
                foreach (DataRow row in info.Rows)
                {
                    TableSchemaExtend schema = this.GetTableSchemaFromRow(row);
                    tableSchemas.Add(schema);
                }
            }
            return(tableSchemas);
        }
        public IList <TableSchemaExtend> LoadTableSchemaList()
        {
            List <TableSchemaExtend> tableSchemas = new List <TableSchemaExtend>();
            String    dataBase = this.GetDataBaseName();
            DataTable info     = this._connection.GetSchema(CollectionNameOfTable, new String[] { null, dataBase, null, null });

            if (info.Rows.Count > 0)
            {
                foreach (DataRow row in info.Rows)
                {
                    TableSchemaExtend schema = this.GetTableSchemaFromRow(row);
                    tableSchemas.Add(schema);
                }
            }
            return(tableSchemas);
        }
Example #6
0
        public (Boolean success, TableSchemaExtend view, IList <ColumnSchemaExtend> columns) GetViewSchemaTuple(String viewName)
        {
            Boolean                    success       = false;
            TableSchemaExtend          viewSchema    = null;
            IList <ColumnSchemaExtend> columnSchemas = null;

            if (String.IsNullOrEmpty(viewName))
            {
                throw new ArgumentException(nameof(viewName));
            }

            DataTable info = this._connection.GetSchema("Views", new String[] { null, this.GetDataBaseName(), viewName, null });

            if (info.Rows.Count > 0)
            {
                var row = info.Rows[0];
                viewSchema    = this.GetTableSchemaFromRow(row);
                columnSchemas = this.LoadViewColumnSchemaList(viewName);
                success       = true;
            }
            return(success, viewSchema, columnSchemas);
        }
Example #7
0
        public (Boolean success, TableSchemaExtend table, IList <ColumnSchemaExtend> columns) GetTableSchemaTuple(String tableName)
        {
            Boolean                    success       = false;
            TableSchemaExtend          tableSchema   = null;
            IList <ColumnSchemaExtend> columnSchemas = null;

            if (String.IsNullOrEmpty(tableName))
            {
                throw new ArgumentException(nameof(tableName));
            }
            String    tableSchemaSQL = String.Format(SQLForColumnSchemaWithWhere, tableName);
            DataTable info           = this.ExecuteQuery(tableSchemaSQL);

            if (info.Rows.Count > 0)
            {
                var row = info.Rows[0];
                tableSchema   = this.GetTableSchemaFromRow(row);
                columnSchemas = this.LoadColumnSchemaList(tableName);
                success       = true;
            }
            return(success, tableSchema, columnSchemas);
        }
        public (Boolean success, TableSchemaExtend table, IList <ColumnSchemaExtend> columns) GetTableSchemaTuple(String tableName)
        {
            Boolean                    success       = false;
            TableSchemaExtend          tableSchema   = null;
            IList <ColumnSchemaExtend> columnSchemas = null;

            if (String.IsNullOrEmpty(tableName))
            {
                throw new ArgumentException(nameof(tableName));
            }

            String    dataBase = this.GetDataBaseName();
            DataTable info     = this._connection.GetSchema(CollectionNameOfTable, new String[] { null, dataBase, tableName, null });

            if (info.Rows.Count > 0)
            {
                var row = info.Rows[0];
                tableSchema   = this.GetTableSchemaFromRow(row);
                columnSchemas = this.LoadColumnSchemaList(tableName);
                success       = true;
            }
            return(success, tableSchema, columnSchemas);
        }