OleDbCommandBuilder.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. using System.Data.ProviderBase;
  38. namespace System.Data.OleDb
  39. {
  40. /// <summary>
  41. /// 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.
  42. /// </summary>
  43. public sealed class OleDbCommandBuilder : AbstractDbCommandBuilder
  44. {
  45. #region Fields
  46. OleDbDataAdapter adapter;
  47. string quotePrefix;
  48. string quoteSuffix;
  49. #endregion // Fields
  50. #region Constructors
  51. public OleDbCommandBuilder ()
  52. {
  53. adapter = null;
  54. quotePrefix = String.Empty;
  55. quoteSuffix = String.Empty;
  56. }
  57. public OleDbCommandBuilder (OleDbDataAdapter adapter)
  58. : this ()
  59. {
  60. this.adapter = adapter;
  61. }
  62. #endregion // Constructors
  63. #region Properties
  64. public OleDbDataAdapter DataAdapter {
  65. get {
  66. return adapter;
  67. }
  68. set {
  69. adapter = value;
  70. }
  71. }
  72. public string QuotePrefix {
  73. get {
  74. return quotePrefix;
  75. }
  76. set {
  77. quotePrefix = value;
  78. }
  79. }
  80. public string QuoteSuffix {
  81. get {
  82. return quoteSuffix;
  83. }
  84. set {
  85. quoteSuffix = value;
  86. }
  87. }
  88. #endregion // Properties
  89. #region Methods
  90. public static void DeriveParameters (OleDbCommand command)
  91. {
  92. DeriveParameters((AbstractDbCommand)command);
  93. }
  94. protected override void Dispose (bool disposing)
  95. {
  96. base.Dispose ();
  97. }
  98. public new OleDbCommand GetDeleteCommand ()
  99. {
  100. return (OleDbCommand) base.GetDeleteCommand ();
  101. }
  102. public new OleDbCommand GetInsertCommand ()
  103. {
  104. return (OleDbCommand) base.GetInsertCommand ();
  105. }
  106. public new OleDbCommand GetUpdateCommand ()
  107. {
  108. return (OleDbCommand) base.GetUpdateCommand ();
  109. }
  110. [MonoTODO]
  111. public void RefreshSchema ()
  112. {
  113. throw new NotImplementedException ();
  114. }
  115. #if NET_2_0
  116. [MonoNotSupported("")]
  117. public string QuoteIdentifier (string unquotedIdentifier, OleDbConnection connection)
  118. {
  119. throw new NotImplementedException ();
  120. }
  121. [MonoNotSupported ("")]
  122. public string UnquoteIdentifier (string quotedIdentifier, OleDbConnection connection)
  123. {
  124. throw new NotImplementedException ();
  125. }
  126. #endif
  127. #endregion // Methods
  128. }
  129. }