OleDbCommandBuilder.cs 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. //
  2. // System.Data.OleDb.OleDbCommandBuilder
  3. //
  4. // Author:
  5. // Rodrigo Moya ([email protected])
  6. // Tim Coleman ([email protected])
  7. //
  8. // Copyright (C) Rodrigo Moya, 2002
  9. // Copyright (C) Tim Coleman, 2002
  10. //
  11. //
  12. // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
  13. //
  14. // Permission is hereby granted, free of charge, to any person obtaining
  15. // a copy of this software and associated documentation files (the
  16. // "Software"), to deal in the Software without restriction, including
  17. // without limitation the rights to use, copy, modify, merge, publish,
  18. // distribute, sublicense, and/or sell copies of the Software, and to
  19. // permit persons to whom the Software is furnished to do so, subject to
  20. // the following conditions:
  21. //
  22. // The above copyright notice and this permission notice shall be
  23. // included in all copies or substantial portions of the Software.
  24. //
  25. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  26. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  28. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  29. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  30. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  31. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  32. //
  33. using System.ComponentModel;
  34. using System.Data;
  35. using System.Data.Common;
  36. namespace System.Data.OleDb
  37. {
  38. /// <summary>
  39. /// 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.
  40. /// </summary>
  41. public sealed class OleDbCommandBuilder :
  42. #if NET_2_0
  43. DbCommandBuilder
  44. #else
  45. Component
  46. #endif
  47. {
  48. #region Fields
  49. OleDbDataAdapter adapter;
  50. #if !NET_2_0
  51. string quotePrefix;
  52. string quoteSuffix;
  53. #endif
  54. #endregion // Fields
  55. #region Constructors
  56. public OleDbCommandBuilder ()
  57. {
  58. #if !NET_2_0
  59. quotePrefix = String.Empty;
  60. quoteSuffix = String.Empty;
  61. #endif
  62. }
  63. public OleDbCommandBuilder (OleDbDataAdapter adapter)
  64. : this ()
  65. {
  66. this.adapter = adapter;
  67. }
  68. #endregion // Constructors
  69. #region Properties
  70. #if !NET_2_0
  71. [DataSysDescriptionAttribute ("The DataAdapter for which to automatically generate OleDbCommands")]
  72. #endif
  73. [DefaultValue (null)]
  74. public new OleDbDataAdapter DataAdapter {
  75. get {
  76. return adapter;
  77. }
  78. set {
  79. adapter = value;
  80. }
  81. }
  82. #if !NET_2_0
  83. [BrowsableAttribute (false)]
  84. [DataSysDescriptionAttribute ("The prefix string wrapped around sql objects")]
  85. [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
  86. public string QuotePrefix {
  87. get {
  88. return quotePrefix;
  89. }
  90. set {
  91. quotePrefix = value;
  92. }
  93. }
  94. [BrowsableAttribute (false)]
  95. [DataSysDescriptionAttribute ("The suffix string wrapped around sql objects")]
  96. [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
  97. public string QuoteSuffix {
  98. get {
  99. return quoteSuffix;
  100. }
  101. set {
  102. quoteSuffix = value;
  103. }
  104. }
  105. #endif
  106. #endregion // Properties
  107. #region Methods
  108. #if NET_2_0
  109. [MonoTODO]
  110. protected override void ApplyParameterInfo (DbParameter parameter, DataRow datarow, StatementType statementType, bool whereClause)
  111. {
  112. throw new NotImplementedException ();
  113. }
  114. #endif
  115. public static void DeriveParameters (OleDbCommand command)
  116. {
  117. throw new NotImplementedException ();
  118. }
  119. #if !NET_2_0
  120. [MonoTODO]
  121. protected override void Dispose (bool disposing)
  122. {
  123. throw new NotImplementedException ();
  124. }
  125. #endif
  126. [MonoTODO]
  127. public new OleDbCommand GetDeleteCommand ()
  128. {
  129. throw new NotImplementedException ();
  130. }
  131. #if NET_2_0
  132. [MonoTODO]
  133. public new OleDbCommand GetDeleteCommand (bool useColumnsForParameterNames)
  134. {
  135. throw new NotImplementedException ();
  136. }
  137. #endif
  138. [MonoTODO]
  139. public new OleDbCommand GetInsertCommand ()
  140. {
  141. throw new NotImplementedException ();
  142. }
  143. #if NET_2_0
  144. [MonoTODO]
  145. public new OleDbCommand GetInsertCommand (bool useColumnsForParameterNames)
  146. {
  147. throw new NotImplementedException ();
  148. }
  149. [MonoTODO]
  150. protected override string GetParameterName (int parameterOrdinal)
  151. {
  152. throw new NotImplementedException ();
  153. }
  154. protected override string GetParameterName (string parameterName)
  155. {
  156. return parameterName;
  157. }
  158. [MonoTODO]
  159. protected override string GetParameterPlaceholder(int parameterOrdinal)
  160. {
  161. throw new NotImplementedException ();
  162. }
  163. #endif
  164. [MonoTODO]
  165. public new OleDbCommand GetUpdateCommand ()
  166. {
  167. throw new NotImplementedException ();
  168. }
  169. #if NET_2_0
  170. [MonoTODO]
  171. public new OleDbCommand GetUpdateCommand (bool useColumnsForParameterNames)
  172. {
  173. throw new NotImplementedException ();
  174. }
  175. [MonoTODO]
  176. public override string QuoteIdentifier(string unquotedIdentifier)
  177. {
  178. return base.QuoteIdentifier (unquotedIdentifier);
  179. }
  180. [MonoTODO]
  181. public string QuoteIdentifier(string unquotedIdentifier, OleDbConnection connection)
  182. {
  183. throw new NotImplementedException ();
  184. }
  185. [MonoTODO]
  186. protected override void SetRowUpdatingHandler(DbDataAdapter adapter)
  187. {
  188. throw new NotImplementedException ();
  189. }
  190. [MonoTODO]
  191. public override string UnquoteIdentifier(string quotedIdentifier)
  192. {
  193. return base.UnquoteIdentifier (quotedIdentifier);
  194. }
  195. [MonoTODO]
  196. public string UnquoteIdentifier(string quotedIdentifier, OleDbConnection connection)
  197. {
  198. throw new NotImplementedException ();
  199. }
  200. #else
  201. [MonoTODO]
  202. public void RefreshSchema ()
  203. {
  204. throw new NotImplementedException ();
  205. }
  206. #endif
  207. #endregion // Methods
  208. }
  209. }