+2002-06-02 Rodrigo Moya <rodrigo@ximian.com>
+
+ * OleDbTransaction.cs (Dispose): added missing method.
+
+ * OleDbCommand.cs (Clone): added missing methods.
+ (Parameters, Transaction, Connection): made these overload
+ IDbCommand's ones.
+
+ * OleDbParameterCollection.cs (IndexOf, Remove, RemoveAt):
+ call m_list methods, not own ones.
+
+ * OleDbParameter.cs: more implementation.
+
2002-06-02 Rodrigo Moya <rodrigo@ximian.com>
* OleDbTransaction.cs (Connection, IsolationLevel, Begin,
private CommandType m_type = CommandType.Text;
private OleDbParameterCollection m_parameters;
+ /*
+ * Constructors
+ */
+
public OleDbCommand ()
{
m_parameters = new OleDbParameterCollection ();
m_transaction = xtrans;
}
+ /*
+ * Properties
+ */
+
string IDbCommand.CommandText
{
get {
}
}
- public OleDbConnection Connection
+ IDbConnection IDbCommand.Connection
{
get {
return m_connection;
}
set {
- m_connection = value;
+ m_connection = (OleDbConnection) value;
}
}
}
}
- public OleDbParameterCollection Parameters
+ IDataParameterCollection IDbCommand.Parameters
{
get {
return m_parameters;
}
}
- public OleDbTransaction Transaction
+ IDbTransaction IDbCommand.Transaction
{
get {
return m_transaction;
}
set {
- m_transaction = value;
+ m_transaction = (OleDbTransaction) value;
}
}
}
}
+ /*
+ * Methods
+ */
+
[MonoTODO]
void IDbCommand.Cancel ()
{
throw new NotImplementedException ();
}
+ [MonoTODO]
+ object ICloneable.Clone ()
+ {
+ throw new NotImplementedException ();
+ }
+
IDbDataParameter IDbCommand.CreateParameter ()
{
return new OleDbParameter ();
public sealed class OleDbParameter : MarshalByRefObject,
IDbDataParameter, IDataParameter, ICloneable
{
- private string m_name;
- private object m_value;
+ private string m_name = null;
+ private object m_value = null;
+ private int m_size = 0;
+ private bool m_isNullable = true;
+ private byte m_precision = 0;
+ private byte m_scale = 0;
+ private DataRowVersion m_sourceVersion;
+ private string m_sourceColumn = null;
+ private ParameterDirection m_direction;
+ private DbType m_type;
+
+ /*
+ * Constructors
+ */
public OleDbParameter ()
{
- m_name = null;
- m_value = null;
}
public OleDbParameter (string name, object value) : this ()
m_value = value;
}
- public OleDbParameter (string name, OleDbType type)
+ public OleDbParameter (string name, OleDbType type) : this ()
{
+ m_name = name;
+ m_type = (DbType) type;
}
public OleDbParameter (string name, OleDbType type, int width)
+ : this (name, type)
{
+ m_size = width;
}
public OleDbParameter (string name, OleDbType type,
int width, string src_col)
+ : this (name, type, width)
{
+ m_name = name;
+ m_type = (DbType) type;
+ m_size = width;
+ m_sourceColumn = src_col;
}
public OleDbParameter(string name, OleDbType type,
- int with, ParameterDirection direction,
+ int width, ParameterDirection direction,
bool is_nullable, byte precision,
byte scale, string src_col,
DataRowVersion src_version, object value)
+ : this (name, type, width, src_col)
{
+ m_direction = direction;
+ m_isNullable = is_nullable;
+ m_precision = precision;
+ m_scale = scale;
+ m_sourceVersion = src_version;
+ m_value = value;
}
/*
* Properties
*/
- public string ParameterName
+ DbType IDataParameter.DbType
+ {
+ get {
+ return m_type;
+ }
+ set {
+ m_type = value;
+ }
+ }
+
+ ParameterDirection IDataParameter.Direction
+ {
+ get {
+ return m_direction;
+ }
+ set {
+ m_direction = value;
+ }
+ }
+
+ bool IDataParameter.IsNullable
+ {
+ get {
+ return m_isNullable;
+ }
+ set {
+ m_isNullable = value;
+ }
+ }
+
+ string IDataParameter.ParameterName
{
get {
return m_name;
m_name = value;
}
}
+
+ byte IDbDataParameter.Precision
+ {
+ get {
+ return m_precision;
+ }
+ set {
+ m_precision = value;
+ }
+ }
+
+ byte IDbDataParameter.Scale
+ {
+ get {
+ return m_scale;
+ }
+ set {
+ m_scale = value;
+ }
+ }
+
+ int IDbDataParameter.Size
+ {
+ get {
+ return m_size;
+ }
+ set {
+ m_size = value;
+ }
+ }
+
+ string IDataParameter.SourceColumn
+ {
+ get {
+ return m_sourceColumn;
+ }
+ set {
+ m_sourceColumn = value;
+ }
+ }
+
+ DataRowVersion IDataParameter.SourceVersion
+ {
+ get {
+ return m_sourceVersion;
+ }
+ set {
+ m_sourceVersion = value;
+ }
+ }
+
+ object IDataParameter.Value
+ {
+ get {
+ return m_value;
+ }
+ set {
+ m_value = value;
+ }
+ }
+
+ /*
+ * Methods
+ */
+
+ [MonoTODO]
+ object ICloneable.Clone ()
+ {
+ throw new NotImplementedException ();
+ }
}
}
}
}
- public OleDbParameter this[int index]
+ public IDataParameter this[int index]
{
get {
- return m_list[index];
+ return (OleDbParameter) m_list[index];
}
set {
m_list[index] = value;
}
}
- public OleDbParameter this[string name]
+ public object this[string name]
{
[MonoTODO]
get {
bool IList.Contains (object value)
{
- return list.Contains (value);
+ return m_list.Contains (value);
}
bool IDataParameterCollection.Contains (string value)
int IDataParameterCollection.IndexOf (string name)
{
- return IndexOf ((object) this[name]);
+ return m_list.IndexOf ((object) this[name]);
}
void IList.Insert (int index, object value)
void IList.RemoveAt (int index)
{
- Remove (m_list[index]);
+ m_list.Remove ((object) m_list[index]);
}
void IDataParameterCollection.RemoveAt (string name)
{
- Remove (this[name]);
+ m_list.Remove ((object) this[name]);
}
}
}