/// <devdoc>
        /// <para>Initializes a new instance of the <see cref='System.Data.DataTable'/> class with no arguments.</para>
        /// </devdoc>
        public DataTable() {
            GC.SuppressFinalize(this);
            Bid.Trace("<ds.DataTable.DataTable|API> %d#\n", ObjectID);
            nextRowID = 1;
            recordManager = new RecordManager(this);

            _culture = CultureInfo.CurrentCulture;
            this.columnCollection = new DataColumnCollection(this);
            this.constraintCollection = new ConstraintCollection(this);
            this.rowCollection = new DataRowCollection(this);
            this.indexes = new List<Index>();

            rowBuilder = new DataRowBuilder(this, -1);
        }
Exemple #2
0
 internal void SetParentRowRecords(DataRow childRow, DataRow parentRow)
 {
     object[] parentKeyValues = parentRow.GetKeyValues(ParentKey);
     if (childRow._tempRecord != -1)
     {
         RecordManager.SetKeyValues(childRow._tempRecord, ChildKey, parentKeyValues);
     }
     if (childRow._newRecord != -1)
     {
         RecordManager.SetKeyValues(childRow._newRecord, ChildKey, parentKeyValues);
     }
     if (childRow._oldRecord != -1)
     {
         RecordManager.SetKeyValues(childRow._oldRecord, ChildKey, parentKeyValues);
     }
 }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref='System.Data.DataTable'/> class with no arguments.
        /// </summary>
        public DataTable()
        {
            GC.SuppressFinalize(this);
            DataCommonEventSource.Log.Trace("<ds.DataTable.DataTable|API> {0}", ObjectID);
            _nextRowID = 1;
            _recordManager = new RecordManager(this);

            _culture = CultureInfo.CurrentCulture;
            _columnCollection = new DataColumnCollection(this);
            _constraintCollection = new ConstraintCollection(this);
            _rowCollection = new DataRowCollection(this);
            _indexes = new List<Index>();

            _rowBuilder = new DataRowBuilder(this, -1);
        }
Exemple #4
0
 private void GrowRecords()
 {
     int[] newRecords = new int[RecordManager.NewCapacity(recordCount)];
     System.Array.Copy(records, 0, newRecords, 0, recordCount);
     records = newRecords;
 }
 public DataTable()
 {
     this.tableName = "";
     this.tablePrefix = "";
     this.fNestedInDataset = true;
     this._compareFlags = CompareOptions.IgnoreWidth | CompareOptions.IgnoreKanaType | CompareOptions.IgnoreCase;
     this.minOccurs = 1M;
     this.maxOccurs = 1M;
     this._primaryIndex = zeroIndexField;
     this.enforceConstraints = true;
     this._nestedParentRelations = EmptyArrayDataRelation;
     this.delayedViews = new List<DataView>();
     this._dataViewListeners = new List<DataViewListener>();
     this.indexesLock = new ReaderWriterLock();
     this.ukColumnPositionForInference = -1;
     this._objectID = Interlocked.Increment(ref _objectTypeCount);
     GC.SuppressFinalize(this);
     Bid.Trace("<ds.DataTable.DataTable|API> %d#\n", this.ObjectID);
     this.nextRowID = 1L;
     this.recordManager = new RecordManager(this);
     this._culture = CultureInfo.CurrentCulture;
     this.columnCollection = new DataColumnCollection(this);
     this.constraintCollection = new ConstraintCollection(this);
     this.rowCollection = new DataRowCollection(this);
     this.indexes = new List<Index>();
     this.rowBuilder = new DataRowBuilder(this, -1);
 }