+2002-07-10 Tim Coleman <tim@timcoleman.com>
+ * OleDbCommandBuilder.cs: Added new methods, properties
+ * OleDbConnection.cs: Modified constructor
+ * OleDbError.cs: Added stubbs
+ * OleDbException.cs: Added stubbs
+ * OleDbInfoMessageEventArgs.cs: Added stubbs
+ * OleDbInfoMessageEventHandler.cs: style change
+ * OleDbParameter.cs: Added conversion from type to OleDbType
+ * OleDbPermission.cs: Added stubbs
+ * OleDbSchemaGuid.cs: Added stubbs
+ * OleDbTransaction.cs: New constructors, changes to methods to
+ support transaction nesting
+ * libgda.cs: Added my name to this file
+
2002-07-09 Tim Coleman <tim@timcoleman.com>
* OleDbCommand.cs: Style changes, added new methods
* OleDbConnection.cs: Style changes, added new methods
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
+// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Rodrigo Moya, 2002
+// Copyright (C) Tim Coleman, 2002
//
using System.ComponentModel;
/// </summary>
public sealed class OleDbCommandBuilder : Component
{
- private OleDbDataAdapter m_adapter = null;
+ #region Fields
+
+ OleDbDataAdapter adapter;
+ string quotePrefix;
+ string quoteSuffix;
+
+ #endregion // Fields
+
+ #region Constructors
public OleDbCommandBuilder ()
{
+ adapter = null;
+ quotePrefix = String.Empty;
+ quoteSuffix = String.Empty;
}
- public OleDbCommandBuilder (OleDbDataAdapter adapter) : this ()
+ public OleDbCommandBuilder (OleDbDataAdapter adapter)
+ : this ()
{
- m_adapter = adapter;
+ this.adapter = adapter;
+ }
+
+ #endregion // Constructors
+
+ #region Properties
+
+ public OleDbDataAdapter DataAdapter {
+ get { return adapter; }
+ set { adapter = value; }
}
- public OleDbDataAdapter DataAdapter
+ public string QuotePrefix {
+ get { return quotePrefix; }
+ set { quotePrefix = value; }
+ }
+
+ public string QuoteSuffix {
+ get { return quoteSuffix; }
+ set { quoteSuffix = value; }
+ }
+
+ #endregion // Properties
+
+ #region Methods
+
+ [MonoTODO]
+ public static void DeriveParameters (OleDbCommand command)
{
- get {
- return m_adapter;
- }
- set {
- m_adapter = value;
- }
+ throw new NotImplementedException ();
}
+
+ [MonoTODO]
+ protected override void Dispose (bool disposing)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public OleDbCommand GetDeleteCommand ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public OleDbCommand GetInsertCommand ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public OleDbCommand GetUpdatetCommand ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void RefreshSchema ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ #endregion // Methods
}
}
#region Fields
string connectionString;
- int connectionTimeout = 15;
+ int connectionTimeout;
OleDbDataReader dataReader;
bool dataReaderOpen;
-
- IntPtr gdaConnection = IntPtr.Zero;
+ IntPtr gdaConnection;
#endregion
public OleDbConnection ()
{
+ gdaConnection = IntPtr.Zero;
+ connectionTimeout = 15;
}
public OleDbConnection (string connectionString)
//
// System.Data.OleDb.OleDbError
//
-// Author:
+// Authors:
// Rodrigo Moya (rodrigo@ximian.com)
+// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Rodrigo Moya, 2002
+// Copyright (C) Tim Coleman, 2002
//
using System.Data;
{
public sealed class OleDbError
{
+ #region Properties
+
+ public string Message {
+ [MonoTODO]
+ get { throw new NotImplementedException (); }
+ }
+
+ public int NativeError {
+ [MonoTODO]
+ get { throw new NotImplementedException (); }
+ }
+
+ public string Source {
+ [MonoTODO]
+ get { throw new NotImplementedException (); }
+ }
+
+ public string SqlState {
+ [MonoTODO]
+ get { throw new NotImplementedException (); }
+ }
+
+ #endregion
+
+ #region Methods
+
+ [MonoTODO]
+ public override string ToString ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ #endregion
}
}
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
+// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Rodrigo Moya, 2002
+// Copyright (C) Tim Coleman, 2002
//
using System.Data;
using System.Data.Common;
using System.Runtime.InteropServices;
+using System.Runtime.Serialization;
namespace System.Data.OleDb
{
[Serializable]
public sealed class OleDbException : ExternalException
{
+ #region Properties
+
+ public override int ErrorCode {
+ [MonoTODO]
+ get { throw new NotImplementedException (); }
+ }
+
+ public OleDbErrorCollection Errors {
+ [MonoTODO]
+ get { throw new NotImplementedException (); }
+ }
+
+ public override string Message {
+ [MonoTODO]
+ get { throw new NotImplementedException (); }
+ }
+
+ public override string Source {
+ [MonoTODO]
+ get { throw new NotImplementedException (); }
+ }
+
+ #endregion // Properties
+
+ #region Methods
+
+ [MonoTODO]
+ public override void GetObjectData (SerializationInfo si, StreamingContext context)
+ {
+ throw new NotImplementedException ();
+ }
+
+ #endregion // Methods
}
}
//
// System.Data.OleDb.OleDbInfoMessageEventArgs
//
-// Author:
+// Authors:
// Rodrigo Moya (rodrigo@ximian.com)
+// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Rodrigo Moya, 2002
+// Copyright (C) Tim Coleman, 2002
//
using System.Data;
{
public sealed class OleDbInfoMessageEventArgs : EventArgs
{
+ #region Properties
+
+ public int ErrorCode {
+ [MonoTODO]
+ get { throw new NotImplementedException (); }
+ }
+
+ public OleDbErrorCollection Errors {
+ [MonoTODO]
+ get { throw new NotImplementedException (); }
+ }
+
+ public string Message {
+ [MonoTODO]
+ get { throw new NotImplementedException (); }
+ }
+
+ public string Source {
+ [MonoTODO]
+ get { throw new NotImplementedException (); }
+ }
+
+ #endregion // Properties
+
+ #region Methods
+
+ [MonoTODO]
+ public override string ToString ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ #endregion // Methods
}
}
namespace System.Data.OleDb
{
[Serializable]
- public delegate void OleDbInfoMessageEventHandler (
- object sender,
- OleDbInfoMessageEventArgs e);
+ public delegate void OleDbInfoMessageEventHandler (object sender, OleDbInfoMessageEventArgs e);
}
// Copyright (C) Tim Coleman, 2002
//
+using System;
using System.Data;
using System.Data.Common;
OleDbType oleDbType;
DbType dbType;
+ IntPtr gdaParameter;
+
#endregion
#region Constructors
precision = 0;
scale = 0;
sourceColumn = String.Empty;
+ gdaParameter = IntPtr.Zero;
}
public OleDbParameter (string name, object value)
{
this.name = name;
this.value = value;
+ OleDbType = GetOleDbType (value);
}
public OleDbParameter (string name, OleDbType dataType)
: this ()
{
this.name = name;
- this.oleDbType = dataType;
+ OleDbType = dataType;
}
public OleDbParameter (string name, OleDbType dataType, int size)
public object Value {
get { return value; }
- set { value = value; }
+ set { this.value = value; }
}
#endregion // Properties
+ #region Internal Properties
+
+ internal IntPtr GdaParameter {
+ get { return gdaParameter; }
+ }
+
+ #endregion // Internal Properties
+
#region Methods
[MonoTODO]
return DbType.Object;
}
+ private OleDbType GetOleDbType (object value)
+ {
+ if (value is Guid) return OleDbType.Guid;
+ if (value is TimeSpan) return OleDbType.DBTime;
+
+ switch (Type.GetTypeCode (value.GetType ())) {
+ case TypeCode.Boolean :
+ return OleDbType.Boolean;
+ case TypeCode.Byte :
+ if (value.GetType().IsArray)
+ return OleDbType.Binary;
+ else
+ return OleDbType.UnsignedTinyInt;
+ case TypeCode.Char :
+ return OleDbType.Char;
+ case TypeCode.DateTime :
+ return OleDbType.Date;
+ case TypeCode.DBNull :
+ return OleDbType.Empty;
+ case TypeCode.Decimal :
+ return OleDbType.Decimal;
+ case TypeCode.Double :
+ return OleDbType.Double;
+ case TypeCode.Empty :
+ return OleDbType.Empty;
+ case TypeCode.Int16 :
+ return OleDbType.SmallInt;
+ case TypeCode.Int32 :
+ return OleDbType.Integer;
+ case TypeCode.Int64 :
+ return OleDbType.BigInt;
+ case TypeCode.SByte :
+ return OleDbType.TinyInt;
+ case TypeCode.String :
+ return OleDbType.VarChar;
+ case TypeCode.Single :
+ return OleDbType.Single;
+ case TypeCode.UInt64 :
+ return OleDbType.UnsignedBigInt;
+ case TypeCode.UInt32 :
+ return OleDbType.UnsignedInt;
+ case TypeCode.UInt16 :
+ return OleDbType.UnsignedSmallInt;
+ case TypeCode.Object :
+ return OleDbType.Variant;
+ }
+ return OleDbType.IUnknown;
+ }
+
#endregion
}
}
//
// Author:
// Rodrigo Moya (rodrigo@ximian.com)
+// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Rodrigo Moya, 2002
+// Copyright (C) Tim Coleman, 2002
//
using System.Data;
using System.Data.Common;
+using System.Security;
+using System.Security.Permissions;
namespace System.Data.OleDb
{
+ [Serializable]
public sealed class OleDbPermission : DBDataPermission
{
+ #region Constructors
+
+ [MonoTODO]
+ public OleDbPermission ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public OleDbPermission (PermissionState state)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public OleDbPermission (PermissionState state, bool allowBlankPassword)
+ {
+ throw new NotImplementedException ();
+ }
+
+ #endregion
+
+ #region Properties
+
+ public string Provider {
+ [MonoTODO]
+ get { throw new NotImplementedException (); }
+ [MonoTODO]
+ set { throw new NotImplementedException (); }
+ }
+
+ #endregion
+
+ #region Methods
+
+ [MonoTODO]
+ public override IPermission Copy ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override void FromXml (SecurityElement securityElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override IPermission Intersect (IPermission target)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override bool IsSubsetOf (IPermission target)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override SecurityElement ToXml ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public override IPermission Union (IPermission target)
+ {
+ throw new NotImplementedException ();
+ }
+
+ #endregion
}
}
//
// System.Data.OleDb.OleDbSchemaGuid
//
-// Author:
+// Authors:
// Rodrigo Moya (rodrigo@ximian.com)
+// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Rodrigo Moya, 2002
+// Copyright (C) Tim Coleman, 2002
//
using System.Data;
{
public sealed class OleDbSchemaGuid
{
+ #region Fields
+
+ public static readonly Guid Assertions;
+ public static readonly Guid Catalogs;
+ public static readonly Guid Character_Sets;
+ public static readonly Guid Check_Constraints;
+ public static readonly Guid Check_Constraints_By_Table;
+ public static readonly Guid Collations;
+ public static readonly Guid Columns;
+ public static readonly Guid Column_Domain_Usage;
+ public static readonly Guid Column_Privileges;
+ public static readonly Guid Constraint_Column_Usage;
+ public static readonly Guid Constraint_Table_Usage;
+ public static readonly Guid DbInfoLiterals;
+ public static readonly Guid Foreign_Keys;
+ public static readonly Guid Indexes;
+ public static readonly Guid Key_Column_Usage;
+ public static readonly Guid Primary_Keys;
+ public static readonly Guid Procedures;
+ public static readonly Guid Procedure_Columns;
+ public static readonly Guid Procedure_Parameters;
+ public static readonly Guid Provider_Types;
+ public static readonly Guid Referential_Constraints;
+ public static readonly Guid Schemata;
+ public static readonly Guid Sql_Languages;
+ public static readonly Guid Statistics;
+ public static readonly Guid Tables;
+ public static readonly Guid Tables_Info;
+ public static readonly Guid Table_Constraints;
+ public static readonly Guid Table_Privileges;
+ public static readonly Guid Table_Statistics;
+ public static readonly Guid Translations;
+ public static readonly Guid Trustee;
+ public static readonly Guid Usage_Privileges;
+ public static readonly Guid Views;
+ public static readonly Guid View_Column_Usage;
+ public static readonly Guid View_Table_Usage;
+
+ #endregion
+
+ #region Constructors
+
+ [MonoTODO]
+ public OleDbSchemaGuid ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ #endregion
}
}
{
public sealed class OleDbTransaction : MarshalByRefObject, IDbTransaction, IDisposable
{
-
#region Fields
- OleDbConnection connection = null;
- IsolationLevel isolationLevel = IsolationLevel.ReadCommitted;
+ OleDbConnection connection;
+ IsolationLevel isolationLevel;
+ IntPtr gdaTransaction;
+ int depth;
#endregion // Fields
#region Constructors
-
- internal OleDbTransaction (OleDbConnection connection)
+
+ internal OleDbTransaction (OleDbConnection connection, int depth)
{
this.connection = connection;
- libgda.gda_connection_begin_transaction (connection.GdaConnection, IntPtr.Zero);
+ isolationLevel = IsolationLevel.ReadCommitted;
+
+ gdaTransaction = libgda.gda_transaction_new (depth.ToString ());
+ libgda.gda_connection_begin_transaction (connection.GdaConnection, gdaTransaction);
}
- internal OleDbTransaction (OleDbConnection connection, IsolationLevel isolevel)
- : this (connection)
+ internal OleDbTransaction (OleDbConnection connection)
+ : this (connection, 1)
+ {
+ }
+
+ internal OleDbTransaction (OleDbConnection connection, int depth, IsolationLevel isolevel)
+ : this (connection, depth)
{
isolationLevel = isolevel;
}
+ internal OleDbTransaction (OleDbConnection connection, IsolationLevel isolevel)
+ : this (connection, 1, isolevel)
+ {
+ }
+
+
#endregion // Constructors
#region Properties
get { return connection; }
}
- public IsolationLevel IsolationLevel
- {
+ public IsolationLevel IsolationLevel {
get { return isolationLevel; }
}
IDbConnection IDbTransaction.Connection {
- [MonoTODO]
- get { throw new NotImplementedException (); }
+ get { return connection; }
}
#endregion // Properties
#region Methods
- public OleDbTransaction Begin ()
+ public OleDbTransaction Begin ()
{
- return new OleDbTransaction (connection);
+ return new OleDbTransaction (connection, depth + 1);
}
- public OleDbTransaction Begin (IsolationLevel isolevel)
+ public OleDbTransaction Begin (IsolationLevel isolevel)
{
- return new OleDbTransaction (connection, isolevel);
+ return new OleDbTransaction (connection, depth + 1, isolevel);
}
public void Commit ()
{
- if (!libgda.gda_connection_commit_transaction (connection.GdaConnection, IntPtr.Zero))
+ if (!libgda.gda_connection_commit_transaction (connection.GdaConnection, gdaTransaction))
throw new InvalidOperationException ();
}
public void Rollback ()
{
- if (!libgda.gda_connection_rollback_transaction (connection.GdaConnection, IntPtr.Zero))
+ if (!libgda.gda_connection_rollback_transaction (connection.GdaConnection, gdaTransaction))
throw new InvalidOperationException ();
}
//
// System.Data.OleDb.libgda
//
-// Author:
+// Authors:
// Rodrigo Moya (rodrigo@ximian.com)
+// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Rodrigo Moya, 2002
+// Copyright (C) Tim Coleman, 2002
//
using System.Data;