2 // System.Data.Common.DbDataReader.cs
5 // Tim Coleman (tim@timcoleman.com)
7 // Copyright (C) Tim Coleman, 2003
11 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
13 // Permission is hereby granted, free of charge, to any person obtaining
14 // a copy of this software and associated documentation files (the
15 // "Software"), to deal in the Software without restriction, including
16 // without limitation the rights to use, copy, modify, merge, publish,
17 // distribute, sublicense, and/or sell copies of the Software, and to
18 // permit persons to whom the Software is furnished to do so, subject to
19 // the following conditions:
21 // The above copyright notice and this permission notice shall be
22 // included in all copies or substantial portions of the Software.
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 using System
.Collections
;
38 namespace System
.Data
.Common
{
39 public abstract class DbDataReader
: MarshalByRefObject
, IDataReader
, IDataReader2
, IDataRecord
, IDataRecord2
, IDisposable
, IEnumerable
43 protected DbDataReader ()
47 #endregion // Constructors
51 public abstract int Depth { get; }
52 public abstract int FieldCount { get; }
53 public abstract bool HasRows { get; }
54 public abstract bool IsClosed { get; }
55 public abstract object this [int index
] { get; }
56 public abstract object this [string name
] { get; }
57 public abstract int RecordsAffected { get; }
58 public abstract int VisibleFieldCount { get; }
60 #endregion // Properties
64 public abstract void Close ();
65 public abstract void Dispose ();
66 public abstract bool GetBoolean (int i
);
67 public abstract byte GetByte (int i
);
68 public abstract long GetBytes (int i
, long fieldOffset
, byte[] buffer
, int bufferOffset
, int length
);
69 public abstract char GetChar (int i
);
70 public abstract long GetChars (int i
, long dataIndex
, char[] buffer
, int bufferIndex
, int length
);
73 public DbDataReader
GetData (int i
)
75 throw new NotImplementedException ();
78 public abstract string GetDataTypeName (int i
);
79 public abstract DateTime
GetDateTime (int i
);
80 public abstract decimal GetDecimal (int i
);
81 public abstract double GetDouble (int i
);
82 public abstract IEnumerator
GetEnumerator ();
83 public abstract Type
GetFieldProviderSpecificType (int i
);
84 public abstract Type
GetFieldType (int i
);
85 public abstract float GetFloat (int i
);
86 public abstract Guid
GetGuid (int i
);
87 public abstract short GetInt16 (int i
);
88 public abstract int GetInt32 (int i
);
89 public abstract long GetInt64 (int i
);
90 public abstract string GetName (int i
);
91 public abstract int GetOrdinal (string name
);
92 public abstract object GetProviderSpecificValue (int i
);
93 public abstract int GetProviderSpecificValues (object[] values
);
94 public abstract DataTable
GetSchemaTable ();
95 public abstract string GetString (int i
);
96 public abstract object GetValue (int i
);
97 public abstract int GetValues (object[] values
);
99 IDataReader IDataRecord
.GetData (int i
)
101 return ((IDataReader
) this).GetData (i
);
104 public abstract bool IsDBNull (int i
);
105 public abstract bool NextResult ();
106 public abstract bool Read ();
108 #endregion // Methods