[DefaultEvent ("RowUpdated")]
[DesignerAttribute ("Microsoft.VSDesigner.Data.VS.OdbcDataAdapterDesigner, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.IDesigner")]
[ToolboxItemAttribute ("Microsoft.VSDesigner.Data.VS.OdbcDataAdapterToolboxItem, "+ Consts.AssemblyMicrosoft_VSDesigner)]
- public sealed class OdbcDataAdapter : DbDataAdapter, IDbDataAdapter
+ public sealed class OdbcDataAdapter : DbDataAdapter, IDbDataAdapter, ICloneable
{
#region Fields
- bool disposed = false;
+#if ONLY_1_1
+ bool disposed;
+#endif
OdbcCommand deleteCommand;
OdbcCommand insertCommand;
OdbcCommand selectCommand;
#region Constructors
- public OdbcDataAdapter ()
- : this (new OdbcCommand ())
+ public OdbcDataAdapter () : this ((OdbcCommand) null)
{
}
public OdbcDataAdapter (OdbcCommand selectCommand)
{
- DeleteCommand = null;
- InsertCommand = null;
SelectCommand = selectCommand;
- UpdateCommand = null;
}
public OdbcDataAdapter (string selectCommandText, OdbcConnection selectConnection)
IDbCommand IDbDataAdapter.DeleteCommand {
get { return DeleteCommand; }
- set {
- if (!(value is OdbcCommand))
- throw new ArgumentException ();
- DeleteCommand = (OdbcCommand)value;
- }
+ set { DeleteCommand = (OdbcCommand) value; }
}
IDbCommand IDbDataAdapter.InsertCommand {
get { return InsertCommand; }
- set {
- if (!(value is OdbcCommand))
- throw new ArgumentException ();
- InsertCommand = (OdbcCommand)value;
- }
+ set { InsertCommand = (OdbcCommand) value; }
}
IDbCommand IDbDataAdapter.SelectCommand {
get { return SelectCommand; }
- set {
- if (!(value is OdbcCommand))
- throw new ArgumentException ();
- SelectCommand = (OdbcCommand)value;
- }
+ set { SelectCommand = (OdbcCommand) value; }
}
IDbCommand IDbDataAdapter.UpdateCommand {
get { return UpdateCommand; }
- set {
- if (!(value is OdbcCommand))
- throw new ArgumentException ();
- UpdateCommand = (OdbcCommand)value;
- }
+ set { UpdateCommand = (OdbcCommand) value; }
}
return new OdbcRowUpdatingEventArgs (dataRow, command, statementType, tableMapping);
}
+#if ONLY_1_1
protected override void Dispose (bool disposing)
{
if (!disposed) {
// Release unmanaged resources
disposed = true;
}
+ base.Dispose (true);
}
+#endif
protected override void OnRowUpdated (RowUpdatedEventArgs value)
{
RowUpdating (this, (OdbcRowUpdatingEventArgs) value);
}
+ [MonoTODO]
+ object ICloneable.Clone ()
+ {
+ throw new NotImplementedException ();
+ }
+
#endregion // Methods
#region Events and Delegates