DbConnection.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. //
  2. // System.Data.Common.DbConnection
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. //
  7. // Copyright (C) Tim Coleman, 2003
  8. //
  9. #if NET_1_2
  10. using System.ComponentModel;
  11. using System.Data;
  12. using System.EnterpriseServices;
  13. namespace System.Data.Common {
  14. public abstract class DbConnection : Component, IDbConnection, IDisposable
  15. {
  16. #region Constructors
  17. protected DbConnection ()
  18. {
  19. }
  20. #endregion // Constructors
  21. #region Properties
  22. public abstract string ConnectionString { get; set; }
  23. public abstract int ConnectionTimeout { get; }
  24. public abstract string Database { get; }
  25. public abstract string DataSource { get; }
  26. public abstract string ServerVersion { get; }
  27. public abstract ConnectionState State { get; }
  28. #endregion // Properties
  29. #region Methods
  30. protected abstract DbTransaction BeginDbTransaction (IsolationLevel isolationLevel);
  31. [MonoTODO]
  32. public DbTransaction BeginTransaction ()
  33. {
  34. throw new NotImplementedException ();
  35. }
  36. [MonoTODO]
  37. public DbTransaction BeginTransaction (IsolationLevel isolationLevel)
  38. {
  39. throw new NotImplementedException ();
  40. }
  41. public abstract void ChangeDatabase (string databaseName);
  42. public abstract void Close ();
  43. public DbCommand CreateCommand ()
  44. {
  45. return CreateDbCommand ();
  46. }
  47. protected abstract DbCommand CreateDbCommand ();
  48. [MonoTODO]
  49. public virtual void EnlistDistributedTransaction (ITransaction transaction)
  50. {
  51. throw new NotImplementedException ();
  52. }
  53. [MonoTODO]
  54. public virtual DataTable GetSchema ()
  55. {
  56. throw new NotImplementedException ();
  57. }
  58. [MonoTODO]
  59. public virtual DataTable GetSchema (string collectionName)
  60. {
  61. throw new NotImplementedException ();
  62. }
  63. [MonoTODO]
  64. public virtual DataTable GetSchema (string collectionName, string[] restrictionValues)
  65. {
  66. throw new NotImplementedException ();
  67. }
  68. IDbTransaction IDbConnection.BeginTransaction ()
  69. {
  70. return BeginTransaction ();
  71. }
  72. IDbTransaction IDbConnection.BeginTransaction (IsolationLevel il)
  73. {
  74. return BeginTransaction (il);
  75. }
  76. IDbCommand IDbConnection.CreateCommand ()
  77. {
  78. return CreateCommand ();
  79. }
  80. public abstract void Open ();
  81. #endregion // Methods
  82. }
  83. }
  84. #endif