OleDbCommandBuilder.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. //
  2. // System.Data.OleDb.OleDbCommandBuilder
  3. //
  4. // Author:
  5. // Rodrigo Moya ([email protected])
  6. // Tim Coleman ([email protected])
  7. // Konstantin Triger <[email protected]>
  8. // Boris Kirzner <[email protected]>
  9. //
  10. // Copyright (C) Rodrigo Moya, 2002
  11. // Copyright (C) Tim Coleman, 2002
  12. // (C) 2005 Mainsoft Corporation (http://www.mainsoft.com)
  13. //
  14. //
  15. // Permission is hereby granted, free of charge, to any person obtaining
  16. // a copy of this software and associated documentation files (the
  17. // "Software"), to deal in the Software without restriction, including
  18. // without limitation the rights to use, copy, modify, merge, publish,
  19. // distribute, sublicense, and/or sell copies of the Software, and to
  20. // permit persons to whom the Software is furnished to do so, subject to
  21. // the following conditions:
  22. //
  23. // The above copyright notice and this permission notice shall be
  24. // included in all copies or substantial portions of the Software.
  25. //
  26. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  27. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  28. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  29. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  30. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  31. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  32. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  33. //
  34. using System.ComponentModel;
  35. using System.Data;
  36. using System.Data.Common;
  37. namespace System.Data.OleDb
  38. {
  39. /// <summary>
  40. /// Provides a means of automatically generating single-table commands used to reconcile changes made to a DataSet with the associated database. This class cannot be inherited.
  41. /// </summary>
  42. public sealed class OleDbCommandBuilder : Component
  43. {
  44. #region Fields
  45. OleDbDataAdapter adapter;
  46. string quotePrefix;
  47. string quoteSuffix;
  48. #endregion // Fields
  49. #region Constructors
  50. public OleDbCommandBuilder ()
  51. {
  52. adapter = null;
  53. quotePrefix = String.Empty;
  54. quoteSuffix = String.Empty;
  55. }
  56. public OleDbCommandBuilder (OleDbDataAdapter adapter)
  57. : this ()
  58. {
  59. this.adapter = adapter;
  60. }
  61. #endregion // Constructors
  62. #region Properties
  63. public OleDbDataAdapter DataAdapter {
  64. get {
  65. return adapter;
  66. }
  67. set {
  68. adapter = value;
  69. }
  70. }
  71. public string QuotePrefix {
  72. get {
  73. return quotePrefix;
  74. }
  75. set {
  76. quotePrefix = value;
  77. }
  78. }
  79. public string QuoteSuffix {
  80. get {
  81. return quoteSuffix;
  82. }
  83. set {
  84. quoteSuffix = value;
  85. }
  86. }
  87. #endregion // Properties
  88. #region Methods
  89. public static void DeriveParameters (OleDbCommand command)
  90. {
  91. if (command.Connection.State != ConnectionState.Open) {
  92. throw new InvalidOperationException("DeriveParameters requires an open and available Connection. The connection's current state is Closed.");
  93. }
  94. command.DeriveParameters ();
  95. }
  96. [MonoTODO]
  97. protected override void Dispose (bool disposing)
  98. {
  99. throw new NotImplementedException ();
  100. }
  101. [MonoTODO]
  102. public OleDbCommand GetDeleteCommand ()
  103. {
  104. throw new NotImplementedException ();
  105. }
  106. [MonoTODO]
  107. public OleDbCommand GetInsertCommand ()
  108. {
  109. throw new NotImplementedException ();
  110. }
  111. [MonoTODO]
  112. public OleDbCommand GetUpdatetCommand ()
  113. {
  114. throw new NotImplementedException ();
  115. }
  116. [MonoTODO]
  117. public void RefreshSchema ()
  118. {
  119. throw new NotImplementedException ();
  120. }
  121. #endregion // Methods
  122. }
  123. }