private void BuildSchemaInfo() { int count = _reader.FieldCount; string[] fieldnames = new string[count]; for (int i = 0; i < count; ++i) { fieldnames[i] = _reader.GetName(i); } ADP.BuildSchemaTableInfoTableNames(fieldnames); SchemaInfo[] si = new SchemaInfo[count]; PropertyDescriptor[] props = new PropertyDescriptor[_reader.FieldCount]; for (int i = 0; i < si.Length; i++) { SchemaInfo s = default; s.name = _reader.GetName(i); s.type = _reader.GetFieldType(i); s.typeName = _reader.GetDataTypeName(i); props[i] = new DbColumnDescriptor(i, fieldnames[i], s.type); si[i] = s; } _schemaInfo = si; _fieldNameLookup = new FieldNameLookup(_reader, -1); _descriptors = new PropertyDescriptorCollection(props); }
// copy all runtime data information internal DataRecordInternal(object[] values, PropertyDescriptorCollection descriptors, FieldNameLookup fieldNameLookup) { Debug.Assert(null != values, "invalid attempt to instantiate DataRecordInternal with null value[]"); _values = values; _propertyDescriptors = descriptors; _fieldNameLookup = fieldNameLookup; }
private void BuildSchemaInfo() { int fieldCount = this._reader.FieldCount; string[] columnNameArray = new string[fieldCount]; for (int i = 0; i < fieldCount; i++) { columnNameArray[i] = this._reader.GetName(i); } ADP.BuildSchemaTableInfoTableNames(columnNameArray); SchemaInfo[] infoArray = new SchemaInfo[fieldCount]; PropertyDescriptor[] properties = new PropertyDescriptor[this._reader.FieldCount]; for (int j = 0; j < infoArray.Length; j++) { SchemaInfo info = new SchemaInfo { name = this._reader.GetName(j), type = this._reader.GetFieldType(j), typeName = this._reader.GetDataTypeName(j) }; properties[j] = new DbColumnDescriptor(j, columnNameArray[j], info.type); infoArray[j] = info; } this._schemaInfo = infoArray; this._fieldNameLookup = new FieldNameLookup(this._reader, -1); this._descriptors = new PropertyDescriptorCollection(properties); }
internal DataRecordInternal(SchemaInfo[] schemaInfo, object[] values, PropertyDescriptorCollection descriptors, FieldNameLookup fieldNameLookup) { this._schemaInfo = schemaInfo; this._values = values; this._propertyDescriptors = descriptors; this._fieldNameLookup = fieldNameLookup; }
// copy all runtime data information internal DataRecordInternal(SchemaInfo[] schemaInfo, object[] values, FieldNameLookup fieldNameLookup) { Debug.Assert(null != schemaInfo, "invalid attempt to instantiate DataRecordInternal with null schema information"); Debug.Assert(null != values, "invalid attempt to instantiate DataRecordInternal with null value[]"); _schemaInfo = schemaInfo; _values = values; _fieldNameLookup = fieldNameLookup; }
private FieldNameLookup _fieldNameLookup; // MDAC 69015 // copy all runtime data information internal DbDataRecord(SchemaInfo[] schemaInfo, object[] values, PropertyDescriptorCollection descriptors, FieldNameLookup fieldNameLookup) { Debug.Assert(null != schemaInfo, "invalid attempt to instantiate DbDataRecord with null schema information"); Debug.Assert(null != values, "invalid attempt to instantiate DbDataRecord with null value[]"); _schemaInfo = schemaInfo; _values = values; _propertyDescriptors = descriptors; _fieldNameLookup = fieldNameLookup; }
private void BuildSchemaInfo() { int count = _reader.FieldCount; string[] fieldnames = new string[count]; for (int i = 0; i < count; ++i) { fieldnames[i] = _reader.GetName(i); } ADP.BuildSchemaTableInfoTableNames(fieldnames); SchemaInfo[] si = new SchemaInfo[count]; for (int i = 0; i < si.Length; i++) { SchemaInfo s = new SchemaInfo(); s.name = _reader.GetName(i); s.type = _reader.GetFieldType(i); s.typeName = _reader.GetDataTypeName(i); si[i] = s; } _schemaInfo = si; _fieldNameLookup = new FieldNameLookup(_reader, -1); }
/// <summary> /// /// </summary> public override int GetOrdinal(string name) { if (null == _fieldNameLookup) { _fieldNameLookup = new FieldNameLookup(this, -1); } return _fieldNameLookup.GetOrdinal(name); }