DbConnectionBase.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. //
  2. // System.Data.ProviderBase.DbConnectionBase
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. //
  7. // Copyright (C) Tim Coleman, 2003
  8. //
  9. //
  10. // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
  11. //
  12. // Permission is hereby granted, free of charge, to any person obtaining
  13. // a copy of this software and associated documentation files (the
  14. // "Software"), to deal in the Software without restriction, including
  15. // without limitation the rights to use, copy, modify, merge, publish,
  16. // distribute, sublicense, and/or sell copies of the Software, and to
  17. // permit persons to whom the Software is furnished to do so, subject to
  18. // the following conditions:
  19. //
  20. // The above copyright notice and this permission notice shall be
  21. // included in all copies or substantial portions of the Software.
  22. //
  23. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  27. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  28. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  29. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  30. //
  31. #if NET_2_0
  32. using System.Data.Common;
  33. using System.EnterpriseServices;
  34. namespace System.Data.ProviderBase {
  35. public abstract class DbConnectionBase : DbConnection
  36. {
  37. #region Fields
  38. DbConnectionFactory connectionFactory;
  39. DbConnectionString connectionOptions;
  40. string connectionString;
  41. #endregion // Fields
  42. #region Constructors
  43. protected DbConnectionBase (DbConnectionBase connection)
  44. : this (connection.ConnectionFactory)
  45. {
  46. }
  47. protected DbConnectionBase (DbConnectionFactory connectionFactory)
  48. {
  49. this.connectionFactory = connectionFactory;
  50. }
  51. protected DbConnectionBase ()
  52. {
  53. }
  54. #endregion // Constructors
  55. #region Properties
  56. [MonoTODO]
  57. protected int CloseCount {
  58. get { throw new NotImplementedException (); }
  59. }
  60. protected internal DbConnectionFactory ConnectionFactory {
  61. get { return connectionFactory; }
  62. }
  63. protected internal DbConnectionString ConnectionOptions {
  64. get { return connectionOptions; }
  65. }
  66. [MonoTODO]
  67. public override string ConnectionString {
  68. get { return connectionString; }
  69. set {
  70. connectionOptions = ConnectionFactory.CreateConnectionOptionsInternal (value);
  71. connectionString = value;
  72. }
  73. }
  74. [MonoTODO]
  75. public override int ConnectionTimeout {
  76. get { throw new NotImplementedException (); }
  77. }
  78. [MonoTODO]
  79. protected virtual int ConnectionTimeoutInternal {
  80. get { throw new NotImplementedException (); }
  81. }
  82. [MonoTODO]
  83. public override string Database {
  84. get { throw new NotImplementedException (); }
  85. }
  86. [MonoTODO]
  87. public override string DataSource {
  88. get { throw new NotImplementedException (); }
  89. }
  90. [MonoTODO]
  91. protected internal DbConnectionInternal InnerConnection {
  92. get { throw new NotImplementedException (); }
  93. }
  94. [MonoTODO]
  95. public override string ServerVersion {
  96. get { throw new NotImplementedException (); }
  97. }
  98. [MonoTODO]
  99. public override ConnectionState State {
  100. get { throw new NotImplementedException (); }
  101. }
  102. #endregion // Properties
  103. #region Events
  104. public event StateChangeEventHandler StateChange;
  105. #endregion // Events
  106. #region Methods
  107. [MonoTODO]
  108. protected override DbTransaction BeginDbTransaction (IsolationLevel isolationLevel)
  109. {
  110. throw new NotImplementedException ();
  111. }
  112. [MonoTODO]
  113. public override void ChangeDatabase (string value)
  114. {
  115. throw new NotImplementedException ();
  116. }
  117. [MonoTODO]
  118. public override void Close ()
  119. {
  120. throw new NotImplementedException ();
  121. }
  122. protected override DbCommand CreateDbCommand ()
  123. {
  124. return (DbCommand) ConnectionFactory.ProviderFactory.CreateCommand ();
  125. }
  126. [MonoTODO]
  127. protected override void Dispose (bool disposing)
  128. {
  129. throw new NotImplementedException ();
  130. }
  131. [MonoTODO]
  132. public override void EnlistDistributedTransaction (ITransaction transaction)
  133. {
  134. throw new NotImplementedException ();
  135. }
  136. [MonoTODO]
  137. public override void EnlistTransaction (ITransaction transaction)
  138. {
  139. throw new NotImplementedException ();
  140. }
  141. [MonoTODO]
  142. protected virtual DbMetaDataFactory GetMetaDataFactory (DbConnectionInternal internalConnection)
  143. {
  144. throw new NotImplementedException ();
  145. }
  146. [MonoTODO]
  147. protected void OnStateChange (ConnectionState originalState, ConnectionState currentState)
  148. {
  149. throw new NotImplementedException ();
  150. }
  151. [MonoTODO]
  152. public override void Open ()
  153. {
  154. throw new NotImplementedException ();
  155. }
  156. [MonoTODO]
  157. public override DataTable GetSchema ()
  158. {
  159. throw new NotImplementedException ();
  160. }
  161. [MonoTODO]
  162. public override DataTable GetSchema (string collectionName)
  163. {
  164. throw new NotImplementedException ();
  165. }
  166. [MonoTODO]
  167. public override DataTable GetSchema (string collectionName, string [] restrictionValues)
  168. {
  169. throw new NotImplementedException ();
  170. }
  171. #endregion // Methods
  172. }
  173. }
  174. #endif