1 //------------------------------------------------------------------------------
2 // <copyright file="DbDataRecord.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">[....]</owner>
6 // <owner current="true" primary="false">[....]</owner>
7 //------------------------------------------------------------------------------
9 namespace System.Data.Common {
11 using System.ComponentModel;
13 public abstract class DbDataRecord : ICustomTypeDescriptor, IDataRecord {
15 protected DbDataRecord() : base() {
18 public abstract int FieldCount {
22 public abstract object this[int i] {
26 public abstract object this[string name] {
30 public abstract bool GetBoolean(int i);
32 public abstract byte GetByte(int i);
34 public abstract long GetBytes(int i, long dataIndex, byte[] buffer, int bufferIndex, int length);
36 public abstract char GetChar(int i);
38 public abstract long GetChars(int i, long dataIndex, char[] buffer, int bufferIndex, int length);
40 public IDataReader GetData(int i) {
41 return GetDbDataReader(i);
44 virtual protected DbDataReader GetDbDataReader(int i) {
45 // NOTE: This method is virtual because we're required to implement
46 // it however most providers won't support it. Only the OLE DB
47 // provider supports it right now, and they can override it.
48 throw ADP.NotSupported();
51 public abstract string GetDataTypeName(int i);
53 public abstract DateTime GetDateTime(int i);
55 public abstract Decimal GetDecimal(int i);
57 public abstract double GetDouble(int i);
59 public abstract Type GetFieldType(int i);
61 public abstract float GetFloat(int i);
63 public abstract Guid GetGuid(int i);
65 public abstract Int16 GetInt16(int i);
67 public abstract Int32 GetInt32(int i);
69 public abstract Int64 GetInt64(int i);
71 public abstract string GetName(int i);
73 public abstract int GetOrdinal(string name);
75 public abstract string GetString(int i);
77 public abstract object GetValue(int i);
79 public abstract int GetValues(object[] values);
81 public abstract bool IsDBNull(int i);
84 // ICustomTypeDescriptor
87 AttributeCollection ICustomTypeDescriptor.GetAttributes() {
88 return new AttributeCollection((Attribute[])null);
92 string ICustomTypeDescriptor.GetClassName() {
96 string ICustomTypeDescriptor.GetComponentName() {
100 TypeConverter ICustomTypeDescriptor.GetConverter() {
104 EventDescriptor ICustomTypeDescriptor.GetDefaultEvent() {
109 PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty() {
113 object ICustomTypeDescriptor.GetEditor(Type editorBaseType) {
117 EventDescriptorCollection ICustomTypeDescriptor.GetEvents() {
118 return new EventDescriptorCollection(null);
121 EventDescriptorCollection ICustomTypeDescriptor.GetEvents(Attribute[] attributes) {
122 return new EventDescriptorCollection(null);
125 PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties() {
126 return((ICustomTypeDescriptor)this).GetProperties(null);
129 PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes) {
130 return new PropertyDescriptorCollection(null);
133 object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd) {