DbDataReaderBase.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. //
  2. // System.Data.ProviderBase.DbDataReaderBase
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. // Boris Kirzner ([email protected])
  7. //
  8. // Copyright (C) Tim Coleman, 2003
  9. //
  10. //
  11. // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
  12. // (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
  13. //
  14. // Permission is hereby granted, free of charge, to any person obtaining
  15. // a copy of this software and associated documentation files (the
  16. // "Software"), to deal in the Software without restriction, including
  17. // without limitation the rights to use, copy, modify, merge, publish,
  18. // distribute, sublicense, and/or sell copies of the Software, and to
  19. // permit persons to whom the Software is furnished to do so, subject to
  20. // the following conditions:
  21. //
  22. // The above copyright notice and this permission notice shall be
  23. // included in all copies or substantial portions of the Software.
  24. //
  25. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  26. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  28. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  29. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  30. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  31. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  32. //
  33. #if NET_2_0 || TARGET_JVM
  34. using System.Collections;
  35. using System.Data.Common;
  36. using System.Runtime.InteropServices;
  37. namespace System.Data.ProviderBase {
  38. public abstract class DbDataReaderBase : DbDataReader
  39. {
  40. #region Fields
  41. CommandBehavior behavior;
  42. #endregion // Fields
  43. #region Constructors
  44. protected DbDataReaderBase (CommandBehavior behavior)
  45. {
  46. this.behavior = behavior;
  47. }
  48. #endregion // Constructors
  49. #region Properties
  50. protected CommandBehavior CommandBehavior {
  51. get { return behavior; }
  52. }
  53. public override int Depth {
  54. // default value to be overriden by user
  55. get { return 0; }
  56. }
  57. [MonoTODO]
  58. public override int FieldCount {
  59. get { throw new NotImplementedException (); }
  60. }
  61. [MonoTODO]
  62. public override bool HasRows {
  63. get { throw new NotImplementedException (); }
  64. }
  65. [MonoTODO]
  66. public override bool IsClosed {
  67. get { throw new NotImplementedException (); }
  68. }
  69. #if NET_2_0
  70. protected abstract bool IsValidRow { get; }
  71. #endif
  72. [MonoTODO]
  73. public override object this [[Optional] int index] {
  74. get { throw new NotImplementedException (); }
  75. }
  76. [MonoTODO]
  77. public override object this [[Optional] string columnName] {
  78. get { throw new NotImplementedException (); }
  79. }
  80. [MonoTODO]
  81. public override int RecordsAffected {
  82. get { throw new NotImplementedException (); }
  83. }
  84. #endregion // Properties
  85. #region Methods
  86. [MonoTODO]
  87. protected void AssertReaderHasColumns ()
  88. {
  89. throw new NotImplementedException ();
  90. }
  91. [MonoTODO]
  92. protected void AssertReaderHasData ()
  93. {
  94. throw new NotImplementedException ();
  95. }
  96. [MonoTODO]
  97. protected void AssertReaderIsOpen (string methodName)
  98. {
  99. throw new NotImplementedException ();
  100. }
  101. [MonoTODO]
  102. public override void Close ()
  103. {
  104. throw new NotImplementedException ();
  105. }
  106. [MonoTODO]
  107. protected static DataTable CreateSchemaTable ()
  108. {
  109. throw new NotImplementedException ();
  110. }
  111. protected override void Dispose (bool disposing)
  112. {
  113. if (disposing)
  114. Close ();
  115. }
  116. [MonoTODO]
  117. protected virtual void FillSchemaTable (DataTable dataTable)
  118. {
  119. throw new NotImplementedException ();
  120. }
  121. [MonoTODO]
  122. public override bool GetBoolean (int ordinal)
  123. {
  124. throw new NotImplementedException ();
  125. }
  126. [MonoTODO]
  127. public override byte GetByte (int ordinal)
  128. {
  129. throw new NotImplementedException ();
  130. }
  131. [MonoTODO]
  132. public override long GetBytes (int ordinal, long fieldoffset, byte[] buffer, int bufferoffset, int length)
  133. {
  134. throw new NotImplementedException ();
  135. }
  136. [MonoTODO]
  137. public override char GetChar (int ordinal)
  138. {
  139. throw new NotImplementedException ();
  140. }
  141. [MonoTODO]
  142. public override long GetChars (int ordinal, long fieldoffset, char[] buffer, int bufferoffset, int length)
  143. {
  144. throw new NotImplementedException ();
  145. }
  146. [MonoTODO]
  147. public override string GetDataTypeName (int ordinal)
  148. {
  149. throw new NotImplementedException ();
  150. }
  151. [MonoTODO]
  152. public override DateTime GetDateTime (int ordinal)
  153. {
  154. throw new NotImplementedException ();
  155. }
  156. [MonoTODO]
  157. public override decimal GetDecimal (int ordinal)
  158. {
  159. throw new NotImplementedException ();
  160. }
  161. [MonoTODO]
  162. public override double GetDouble (int ordinal)
  163. {
  164. throw new NotImplementedException ();
  165. }
  166. public override IEnumerator GetEnumerator ()
  167. {
  168. bool closeReader = (CommandBehavior & CommandBehavior.CloseConnection) != 0;
  169. return new DbEnumerator (this , closeReader);
  170. }
  171. [MonoTODO]
  172. public override Type GetFieldType (int ordinal)
  173. {
  174. throw new NotImplementedException ();
  175. }
  176. [MonoTODO]
  177. public override float GetFloat (int ordinal)
  178. {
  179. throw new NotImplementedException ();
  180. }
  181. [MonoTODO]
  182. public override Guid GetGuid (int ordinal)
  183. {
  184. throw new NotImplementedException ();
  185. }
  186. [MonoTODO]
  187. public override short GetInt16 (int ordinal)
  188. {
  189. throw new NotImplementedException ();
  190. }
  191. [MonoTODO]
  192. public override int GetInt32 (int ordinal)
  193. {
  194. throw new NotImplementedException ();
  195. }
  196. [MonoTODO]
  197. public override long GetInt64 (int ordinal)
  198. {
  199. throw new NotImplementedException ();
  200. }
  201. [MonoTODO]
  202. public override string GetName (int ordinal)
  203. {
  204. throw new NotImplementedException ();
  205. }
  206. [MonoTODO]
  207. public override int GetOrdinal (string name)
  208. {
  209. throw new NotImplementedException ();
  210. }
  211. [MonoTODO]
  212. public override DataTable GetSchemaTable ()
  213. {
  214. throw new NotImplementedException ();
  215. }
  216. [MonoTODO]
  217. public override string GetString (int ordinal)
  218. {
  219. throw new NotImplementedException ();
  220. }
  221. [MonoTODO]
  222. public override object GetValue (int ordinal)
  223. {
  224. throw new NotImplementedException ();
  225. }
  226. [MonoTODO]
  227. public override int GetValues (object[] values)
  228. {
  229. throw new NotImplementedException ();
  230. }
  231. [MonoTODO]
  232. protected bool IsCommandBehavior (CommandBehavior condition)
  233. {
  234. throw new NotImplementedException ();
  235. }
  236. [MonoTODO]
  237. public override bool IsDBNull (int ordinal)
  238. {
  239. throw new NotImplementedException ();
  240. }
  241. [MonoTODO]
  242. public override bool NextResult ()
  243. {
  244. throw new NotImplementedException ();
  245. }
  246. [MonoTODO]
  247. public override bool Read ()
  248. {
  249. throw new NotImplementedException ();
  250. }
  251. #endregion // Methods
  252. }
  253. }
  254. #endif