System.Data.Common.DataStorage.Set(int, object)

Here are the examples of the csharp api class System.Data.Common.DataStorage.Set(int, object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

4 Examples 7

1. Example

Project: referencesource
Source File: DataColumn.cs
View license
internal void InitializeRecord(int record) {
            Debug.Assert(null != _storage, "no storage");
            _storage.Set(record, DefaultValue);
        }

2. Example

Project: referencesource
Source File: DataColumn.cs
View license
internal void FreeRecord(int record) {
            Debug.Assert(null != _storage, "no storage");
            _storage.Set(record, _storage.NullValue);
        }

3. Example

Project: referencesource
Source File: DataColumn.cs
View license
internal void Init(int record) {
            if (AutoIncrement) {
                object value = this.autoInc.Current;
                this.autoInc.MoveAfter();
                Debug.Assert(null != _storage, "no storage");
                _storage.Set(record, value);
            }
            else
                this[record] = defaultValue;
        }

4. Example

Project: referencesource
Source File: DataColumn.cs
View license
internal void SetValue(int record, object value) { // just silently set the value
            try {
                Debug.Assert(null != value, "setting null, expecting dbnull");
                Debug.Assert(null != this.table, "storage with no DataTable on column");
                Debug.Assert(null != _storage, "no storage");
                _storage.Set(record, value);
            }
            catch (Exception e) {
                ExceptionBuilder.TraceExceptionForCapture(e);
                throw ExceptionBuilder.SetFailed(value, this, DataType, e);
            }

            DataRow dr = GetDataRow(record);
            if (dr != null) {  // at initialization time (datatable.NewRow(), we would fill the storage with default value, but at that time we wont have datarow)
                dr.LastChangedColumn = this;
            }
        }