示例#1
0
        public void Execute(Database database)
        {
            Table table = database.GetTable(this.tableName);

            if (this.columnNames.Count == 0)
            {
                this.result = table.GetRows();
                return;
            }

            RowDefinition rowdef = new RowDefinition();
            IList<Row> rows = new List<Row>();

            foreach (var name in this.columnNames)
                rowdef.AddColumn(table.GetColumn(name));

            int nc = this.columnNames.Count;

            foreach (var row in table.GetRows())
            {
                object[] values = new object[nc];

                for (int k = 0; k < nc; k++)
                    values[k] = row[this.columnNames[k]];

                rows.Add(new Row(rowdef, values));
            }

            this.result = new RowList(rows);
        }
示例#2
0
        public void Execute(Database database)
        {
            Table table = database.GetTable(this.tableName);

            if (this.columnNames.Count == 0)
            {
                this.result = table.GetRows();
                return;
            }

            RowDefinition rowdef = new RowDefinition();
            IList <Row>   rows   = new List <Row>();

            foreach (var name in this.columnNames)
            {
                rowdef.AddColumn(table.GetColumn(name));
            }

            int nc = this.columnNames.Count;

            foreach (var row in table.GetRows())
            {
                object[] values = new object[nc];

                for (int k = 0; k < nc; k++)
                {
                    values[k] = row[this.columnNames[k]];
                }

                rows.Add(new Row(rowdef, values));
            }

            this.result = new RowList(rows);
        }