DbCommandBase.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. //
  2. // System.Data.ProviderBase.DbCommandBase
  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. namespace System.Data.ProviderBase {
  34. public abstract class DbCommandBase : DbCommand
  35. {
  36. #region Fields
  37. string commandText;
  38. int commandTimeout;
  39. CommandType commandType;
  40. bool designTimeVisible;
  41. UpdateRowSource updatedRowSource;
  42. #endregion // Fields
  43. #region Constructors
  44. protected DbCommandBase ()
  45. {
  46. CommandText = String.Empty;
  47. CommandTimeout = 30;
  48. CommandType = CommandType.Text;
  49. DesignTimeVisible = true;
  50. UpdatedRowSource = UpdateRowSource.Both;
  51. }
  52. protected DbCommandBase (DbCommandBase from)
  53. {
  54. }
  55. #endregion // Constructors
  56. #region Properties
  57. public override string CommandText {
  58. get { return commandText; }
  59. set { commandText = value; }
  60. }
  61. public override int CommandTimeout {
  62. get { return commandTimeout; }
  63. set { commandTimeout = value; }
  64. }
  65. public override CommandType CommandType {
  66. get { return commandType; }
  67. set { commandType = value; }
  68. }
  69. public override bool DesignTimeVisible {
  70. get { return designTimeVisible; }
  71. set { designTimeVisible = value; }
  72. }
  73. public override UpdateRowSource UpdatedRowSource {
  74. get { return updatedRowSource; }
  75. set { updatedRowSource = value; }
  76. }
  77. #endregion // Properties
  78. #region Methods
  79. [MonoTODO]
  80. public override void Cancel ()
  81. {
  82. throw new NotImplementedException ();
  83. }
  84. [MonoTODO]
  85. public override int ExecuteNonQuery ()
  86. {
  87. DbDataReader reader = ExecuteReader ();
  88. reader.Close ();
  89. return reader.RecordsAffected;
  90. }
  91. [MonoTODO]
  92. public override object ExecuteScalar ()
  93. {
  94. throw new NotImplementedException ();
  95. }
  96. [MonoTODO]
  97. public override void Prepare ()
  98. {
  99. throw new NotImplementedException ();
  100. }
  101. [MonoTODO]
  102. public virtual void PropertyChanging ()
  103. {
  104. throw new NotImplementedException ();
  105. }
  106. [MonoTODO]
  107. public virtual void ResetCommandTimeout ()
  108. {
  109. throw new NotImplementedException ();
  110. }
  111. [MonoTODO]
  112. protected internal static void SetInputParameterValues (DbCommand command, object[] inputParameterValues)
  113. {
  114. throw new NotImplementedException ();
  115. }
  116. #endregion // Methods
  117. }
  118. }
  119. #endif