Пример #1
0
        public TableRow GetRow(RowId rowid)
        {
            if (rowid.ToInt64() != 0)
                throw new ArgumentOutOfRangeException("rowid");

            if (row == null) {
                row = new TableRow(this, new RowId(0));
                for (int i = 0; i < columns.Count; i++)
                    row.SetValue(i, values[i]);
            }

            return row;
        }
Пример #2
0
        public TableRow GetRow(RowId rowid)
        {
            // Null value if the rowid is less than 0
            if (rowid == null || rowid.ToInt64() < 0)
                return null;

            int sz = Columns.Count;
            TableRow row = new TableRow(this, rowid);
            for (int i = 0; i < sz; i++) {
                int tableIndex = columns.IndexOfTable(i);
                // Adjust the column to the table the column is located
                int tableColumn = columns.AdjustColumn(i);
                // Adjust the row by the table
                RowId tableRow = AdjustRow(rowid.ToInt64(), tableIndex);

                // Fetch and return the data
                SqlObject value = tables[tableIndex].GetValue(tableColumn, tableRow);

                TableColumn column = Columns[i];
                row.SetValue(column.Offset, value);
            }

            return row;
        }