ExpressionUnbound() public static method

public static ExpressionUnbound ( string expr ) : Exception
expr string
return System.Exception
Esempio n. 1
0
        internal override void Bind(DataTable table, List <DataColumn> list)
        {
            base.BindTable(table);
            this.column   = null;
            this.relation = null;
            if (table == null)
            {
                throw ExprException.ExpressionUnbound(this.ToString());
            }
            DataRelationCollection parentRelations = table.ParentRelations;

            if (this.relationName == null)
            {
                if (parentRelations.Count > 1)
                {
                    throw ExprException.UnresolvedRelation(table.TableName, this.ToString());
                }
                this.relation = parentRelations[0];
            }
            else
            {
                this.relation = parentRelations[this.relationName];
            }
            if (this.relation == null)
            {
                throw ExprException.BindFailure(this.relationName);
            }
            DataTable parentTable = this.relation.ParentTable;

            this.column = parentTable.Columns[this.columnName];
            if (this.column == null)
            {
                throw ExprException.UnboundName(this.columnName);
            }
            int num = 0;

            while (num < list.Count)
            {
                DataColumn column = list[num];
                if (this.column == column)
                {
                    break;
                }
                num++;
            }
            if (num >= list.Count)
            {
                list.Add(this.column);
            }
            AggregateNode.Bind(this.relation, list);
        }
Esempio n. 2
0
        internal override object Eval(DataRow row, DataRowVersion version)
        {
            if ((this.column == null) || (this.relation == null))
            {
                throw ExprException.ExpressionUnbound(this.ToString());
            }
            DataRow parentRow = row.GetParentRow(this.relation, version);

            if (parentRow == null)
            {
                return(DBNull.Value);
            }
            return(parentRow[this.column, parentRow.HasVersion(version) ? version : DataRowVersion.Current]);
        }
Esempio n. 3
0
        internal override object Eval(DataRow row, DataRowVersion version)
        {
            if (_column == null || _relation == null)
            {
                throw ExprException.ExpressionUnbound(ToString());
            }

            DataRow parent = row.GetParentRow(_relation, version);

            if (parent == null)
            {
                return(DBNull.Value);
            }

            return(parent[_column, parent.HasVersion(version) ? version : DataRowVersion.Current]);
        }
Esempio n. 4
0
        internal override object Eval(DataRow row, DataRowVersion version)
        {
#if DEBUG
            if (CompModSwitches.LookupNode.TraceVerbose)
            {
                Debug.WriteLine("Eval " + this.ToString());
            }
#endif

            if (table == null || column == null || relation == null)
            {
                throw ExprException.ExpressionUnbound(this.ToString());
            }

            DataRow parent = row.GetParentRow(relation, version);
            if (parent == null)
            {
                return(DBNull.Value);
            }

            return(parent[column, parent.HasVersion(version) ? version : DataRowVersion.Current]); // haroona : Bug 76154
        }
Esempio n. 5
0
        internal override void Bind(DataTable table, ArrayList list)
        {
#if DEBUG
            if (CompModSwitches.LookupNode.TraceVerbose)
            {
                Debug.WriteLine("Binding lookup column " + this.ToString());
            }
#endif

            if (table == null)
            {
                throw ExprException.ExpressionUnbound(this.ToString());
            }

            // First find parent table

            DataRelationCollection relations;
            relations = table.ParentRelations;

            if (relationName == null)
            {
                // must have one and only one relation

                if (relations.Count > 1)
                {
                    throw ExprException.UnresolvedRelation(table.TableName, this.ToString());
                }
                relation = relations[0];
            }
            else
            {
                relation = relations[relationName];
            }

            Debug.Assert(relation != null, "The relation should be resolved (bound) at this point.");

            this.table = relation.ParentTable;

            Debug.Assert(relation != null, "Invalid relation: no parent table.");
            Debug.Assert(columnName != null, "All Lookup expressions have columnName set.");

            this.column = this.table.Columns[columnName];

            if (column == null)
            {
                throw ExprException.UnboundName(columnName);
            }

            // add column to the dependency list

            Debug.Assert(column != null, "Failed to bind column " + columnName);

            int i;
            for (i = 0; i < list.Count; i++)
            {
                // walk the list, check if the current column already on the list
                DataColumn dataColumn = (DataColumn)list[i];
                if (column == dataColumn)
                {
#if DEBUG
                    if (CompModSwitches.LookupNode.TraceVerbose)
                    {
                        Debug.WriteLine("the column found in the dependency list");
                    }
#endif
                    break;
                }
            }
            if (i >= list.Count)
            {
#if DEBUG
                if (CompModSwitches.LookupNode.TraceVerbose)
                {
                    Debug.WriteLine("Adding column to our dependency list: " + column.ColumnName);
                }
#endif
                list.Add(column);
            }
        }
Esempio n. 6
0
        internal override void Bind(DataTable table, List <DataColumn> list)
        {
            BindTable(table);
            _column   = null; // clear for rebinding (if original binding was valid)
            _relation = null;

            if (table == null)
            {
                throw ExprException.ExpressionUnbound(ToString());
            }

            // First find parent table

            DataRelationCollection relations;

            relations = table.ParentRelations;

            if (_relationName == null)
            {
                // must have one and only one relation

                if (relations.Count > 1)
                {
                    throw ExprException.UnresolvedRelation(table.TableName, ToString());
                }
                _relation = relations[0];
            }
            else
            {
                _relation = relations[_relationName];
            }
            if (null == _relation)
            {
                throw ExprException.BindFailure(_relationName); // this operation is not clone specific, throw generic exception
            }
            DataTable parentTable = _relation.ParentTable;

            Debug.Assert(_relation != null, "Invalid relation: no parent table.");
            Debug.Assert(_columnName != null, "All Lookup expressions have columnName set.");

            _column = parentTable.Columns[_columnName];

            if (_column == null)
            {
                throw ExprException.UnboundName(_columnName);
            }

            // add column to the dependency list

            int i;

            for (i = 0; i < list.Count; i++)
            {
                // walk the list, check if the current column already on the list
                DataColumn dataColumn = list[i];
                if (_column == dataColumn)
                {
                    break;
                }
            }
            if (i >= list.Count)
            {
                list.Add(_column);
            }

            AggregateNode.Bind(_relation, list);
        }
Esempio n. 7
0
        internal override void Bind(DataTable table, List <DataColumn> list)
        {
            BindTable(table);
            column   = null; // clear for rebinding (if original binding was valid)
            relation = null;

            if (table == null)
            {
                throw ExprException.ExpressionUnbound(this.ToString());
            }

            // First find parent table

            DataRelationCollection relations;

            relations = table.ParentRelations;

            if (relationName == null)
            {
                // must have one and only one relation

                if (relations.Count > 1)
                {
                    throw ExprException.UnresolvedRelation(table.TableName, this.ToString());
                }
                relation = relations[0];
            }
            else
            {
                relation = relations[relationName];
            }
            if (null == relation)
            {
                throw ExprException.BindFailure(relationName);// WebData 112162: this operation is not clne specific, throw generic exception
            }
            DataTable parentTable = relation.ParentTable;

            Debug.Assert(relation != null, "Invalid relation: no parent table.");
            Debug.Assert(columnName != null, "All Lookup expressions have columnName set.");

            this.column = parentTable.Columns[columnName];

            if (column == null)
            {
                throw ExprException.UnboundName(columnName);
            }

            // add column to the dependency list

            int i;

            for (i = 0; i < list.Count; i++)
            {
                // walk the list, check if the current column already on the list
                DataColumn dataColumn = list[i];
                if (column == dataColumn)
                {
                    break;
                }
            }
            if (i >= list.Count)
            {
                list.Add(column);
            }

            // SQLBU 383715: Staleness of computed values in expression column as the relationship end columns are not being added to the dependent column list.
            AggregateNode.Bind(relation, list);
        }