2 // OracleDataAdapter.cs
4 // Part of the Mono class libraries at
5 // mcs/class/System.Data.OracleClient/System.Data.OracleClient
7 // Assembly: System.Data.OracleClient.dll
8 // Namespace: System.Data.OracleClient
10 // Author: Tim Coleman <tim@timcoleman.com>
12 // Parts transferred from System.Data.SqlClient/SqlDataAdapter.cs
14 // Rodrigo Moya (rodrigo@ximian.com)
15 // Daniel Morgan (danmorg@sc.rr.com)
16 // Tim Coleman (tim@timcoleman.com)
18 // Copyright (C) Tim Coleman, 2003
19 // (C) Ximian, Inc 2002
21 // Licensed under the MIT/X11 License.
25 using System.ComponentModel;
27 using System.Data.Common;
28 using System.Drawing.Design;
30 namespace System.Data.OracleClient
32 [DefaultEvent ("RowUpdated")]
33 [Designer ("Microsoft.VSDesigner.Data.VS.OracleDataAdapterDesigner, " + Consts.AssemblyMicrosoft_VSDesigner)]
34 [ToolboxItem ("Microsoft.VSDesigner.Data.VS.OracleDataAdapterToolboxItem, " + Consts.AssemblyMicrosoft_VSDesigner)]
35 public sealed class OracleDataAdapter : DbDataAdapter, IDbDataAdapter
39 OracleCommand deleteCommand;
40 OracleCommand insertCommand;
41 OracleCommand selectCommand;
42 OracleCommand updateCommand;
51 public OracleDataAdapter () : this ((OracleCommand) null)
55 public OracleDataAdapter (OracleCommand selectCommand)
57 SelectCommand = selectCommand;
63 public OracleDataAdapter (string selectCommandText, OracleConnection selectConnection)
64 : this (new OracleCommand (selectCommandText, selectConnection))
68 public OracleDataAdapter (string selectCommandText, string selectConnectionString)
69 : this (selectCommandText, new OracleConnection (selectConnectionString))
78 [Editor ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, " + Consts.AssemblyMicrosoft_VSDesigner, typeof(UITypeEditor))]
79 public new OracleCommand DeleteCommand {
80 get { return deleteCommand; }
81 set { deleteCommand = value; }
85 [Editor ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, " + Consts.AssemblyMicrosoft_VSDesigner, typeof(UITypeEditor))]
86 public new OracleCommand InsertCommand {
87 get { return insertCommand; }
88 set { insertCommand = value; }
92 [Editor ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, " + Consts.AssemblyMicrosoft_VSDesigner, typeof(UITypeEditor))]
93 public new OracleCommand SelectCommand {
94 get { return selectCommand; }
95 set { selectCommand = value; }
99 [Editor ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, " + Consts.AssemblyMicrosoft_VSDesigner, typeof(UITypeEditor))]
100 public new OracleCommand UpdateCommand {
101 get { return updateCommand; }
102 set { updateCommand = value; }
106 public override int UpdateBatchSize {
107 get { return updateBatchSize; }
110 throw new ArgumentOutOfRangeException ("UpdateBatchSize");
111 updateBatchSize = value;
116 IDbCommand IDbDataAdapter.DeleteCommand {
117 get { return DeleteCommand; }
118 set { DeleteCommand = (OracleCommand) value; }
121 IDbCommand IDbDataAdapter.InsertCommand {
122 get { return InsertCommand; }
123 set { InsertCommand = (OracleCommand) value; }
126 IDbCommand IDbDataAdapter.SelectCommand {
127 get { return SelectCommand; }
128 set { SelectCommand = (OracleCommand) value; }
131 IDbCommand IDbDataAdapter.UpdateCommand {
132 get { return UpdateCommand; }
133 set { UpdateCommand = (OracleCommand) value; }
136 #endregion // Properties
140 protected override RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
142 return new OracleRowUpdatedEventArgs (dataRow, command, statementType, tableMapping);
146 protected override RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
148 return new OracleRowUpdatingEventArgs (dataRow, command, statementType, tableMapping);
151 protected override void OnRowUpdated (RowUpdatedEventArgs value)
153 if (RowUpdated != null)
154 RowUpdated (this, (OracleRowUpdatedEventArgs) value);
157 protected override void OnRowUpdating (RowUpdatingEventArgs value)
159 if (RowUpdating != null)
160 RowUpdating (this, (OracleRowUpdatingEventArgs) value);
163 #endregion // Methods
165 #region Events and Delegates
167 public event OracleRowUpdatedEventHandler RowUpdated;
168 public event OracleRowUpdatingEventHandler RowUpdating;
170 #endregion // Events and Delegates