diff options
author | Senganal T <senga@mono-cvs.ximian.com> | 2005-11-21 16:08:48 +0300 |
---|---|---|
committer | Senganal T <senga@mono-cvs.ximian.com> | 2005-11-21 16:08:48 +0300 |
commit | ec248e159f39ef71d05225cc565f34f628a94dc1 (patch) | |
tree | ba2510c5b5b6033bf51c2b1cb81847504dfaa92f /mcs/class/System.Data/System.Data.Common | |
parent | 775664f445b6e78d375fdaae434f88cf3dc0ec13 (diff) |
2005-11-21 Senganal T <tsenganal@novell.com>
* System/System.Net/Dns.cs : added GetHostEntry() method for 2.0 api conformance
* System.Data/System.Data.ProviderBase/DbParameterCollectionBase.cs
- Marked CheckName method as virtual
* System.Data/System.Data.ProviderBase/DbParameterBase.cs
- Marked Offset property and CopyTo method as virtual
* System.Data/System.Data.Common/DbMetaDataCollectionNames.cs (new file)
- Added DbMetaDataCollectionNames Enumeration
* System.Data/System.Data.dll.sources:
- Added System.Data/ConflictOption.cs : Source file for ConflictOption
enumeration.
* System.Data/System.Data/ConflictOption.cs (new file)
- Added ConflictOption Enumeration
* System.Data/System.Data/DataTableReader.cs
* System.Data/System.Data/IDataRecord2.cs
- GetProviderSpecificFieldType : Corrected the method name
* System.Data/System.Data.Common/DbDataAdapter.cs
* System.Data/System.Data.Common/DbParameter.cs
* System.Data/System.Data.Common/DbTransaction.cs
* System.Data/System.Data.Common/DbTable.cs
* System.Data/System.Data.Common/DbProviderFactories.cs
* System.Data/System.Data.Common/DbException.cs
* System.Data/System.Data.Common/DbProviderFactory.cs
* System.Data/System.Data.Common/DbCommandBuilder.cs
* System.Data/System.Data.Common/DbDataReader.cs
* System.Data/System.Data.Common/DbParameterCollection.cs
* System.Data/System.Data.SqlClient/SqlClientFactory.cs
* System.Data/System.Data.SqlClient/SqlCommandBuilder.cs
* System.Data/System.Data.SqlClient/SqlParameterCollection.cs
* System.Data/System.Data.SqlClient/SqlDataReader.cs
* System.Data/System.Data.SqlClient/SqlDataAdapter.cs
* System.Data/System.Data.SqlClient/SqlParameter.cs
* System.Data/System.Data.SqlClient/SqlTransaction.cs
* System.Data/System.Data.Odbc/OdbcTransaction.cs
* System.Data/System.Data.Odbc/OdbcCommandBuilder.cs
* System.Data/System.Data.Odbc/OdbcParameterCollection.cs
* System.Data/System.Data.Odbc/OdbcDataReader.cs
* System.Data/System.Data.Odbc/OdbcFactory.cs
* System.Data/System.Data.Odbc/OdbcDataAdapter.cs
* System.Data/System.Data.Odbc/OdbcParameter.cs
Added stubs and other changes for ADO.NET 2.0 compatibility
svn path=/trunk/mcs/; revision=53301
Diffstat (limited to 'mcs/class/System.Data/System.Data.Common')
12 files changed, 213 insertions, 42 deletions
diff --git a/mcs/class/System.Data/System.Data.Common/ChangeLog b/mcs/class/System.Data/System.Data.Common/ChangeLog index 2347432ae32..c835d94f9a6 100644 --- a/mcs/class/System.Data/System.Data.Common/ChangeLog +++ b/mcs/class/System.Data/System.Data.Common/ChangeLog @@ -1,3 +1,19 @@ +2005-11-21 Senganal T <tsenganal@novell.com> + + * DbDataAdapter.cs + * DbParameter.cs + * DbTransaction.cs + * DbTable.cs + * DbProviderFactories.cs + * DbException.cs + * DbProviderFactory.cs + * DbCommandBuilder.cs + * DbDataReader.cs + * DbParameterCollection.cs + - Added stubs and other changes for ADO.NET 2.0 compatibility. + * DbMetaDataCollectionNames.cs (new file) + - Added DbMetaDataCollectionNames Enumeration + 2005-10-24 Konstantin Triger <kostat@mainsoft.com> * DataContainer.cs: removed extra type validation for object container diff --git a/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs b/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs index 57bae5fc1b5..4a8b3a5bd34 100644 --- a/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs +++ b/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs @@ -62,7 +62,7 @@ namespace System.Data.Common { } [MonoTODO] - public virtual ConflictOptions ConflictDetection { + public virtual ConflictOption ConflictOption { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } } @@ -73,8 +73,6 @@ namespace System.Data.Common { set { throw new NotImplementedException (); } } - protected abstract DbProviderFactory ProviderFactory { get; } - [MonoTODO] public virtual string QuotePrefix { get { throw new NotImplementedException (); } @@ -98,12 +96,15 @@ namespace System.Data.Common { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } } - + #endregion // Properties #region Methods - protected abstract void ApplyParameterInfo (IDbDataParameter p, DataRow row); + protected abstract void ApplyParameterInfo (DbParameter parameter, + DataRow row, + StatementType statementType, + bool whereClause); [MonoTODO] protected virtual void BuildCache (bool closeConnection, DataRow dataRow) @@ -136,6 +137,12 @@ namespace System.Data.Common { } [MonoTODO] + public DbCommand GetDeleteCommand (bool option) + { + throw new NotImplementedException (); + } + + [MonoTODO] public DbCommand GetDeleteCommand (DataRow dataRow) { throw new NotImplementedException (); @@ -148,12 +155,19 @@ namespace System.Data.Common { } [MonoTODO] + public DbCommand GetInsertCommand (bool option) + { + throw new NotImplementedException (); + } + + [MonoTODO] public DbCommand GetInsertCommand (DataRow dataRow) { throw new NotImplementedException (); } protected abstract string GetParameterName (int parameterOrdinal); + protected abstract string GetParameterName (String parameterName); protected abstract string GetParameterPlaceholder (int parameterOrdinal); [MonoTODO] @@ -169,6 +183,12 @@ namespace System.Data.Common { } [MonoTODO] + public DbCommand GetUpdateCommand (bool option) + { + throw new NotImplementedException (); + } + + [MonoTODO] public DbCommand GetUpdateCommand (DataRow dataRow) { throw new NotImplementedException (); @@ -205,6 +225,12 @@ namespace System.Data.Common { } [MonoTODO] + protected void RowUpdatingHandler (RowUpdatingEventArgs rowUpdatingEvent) + { + throw new NotImplementedException (); + } + + [MonoTODO] protected void RowUpdatingHandler (object sender, RowUpdatingEventArgs rowUpdatingEvent) { throw new NotImplementedException (); diff --git a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs b/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs index 6995d97fbdf..d188b417669 100644 --- a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs +++ b/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs @@ -40,7 +40,11 @@ using System.Data; using System.Runtime.InteropServices; namespace System.Data.Common { +#if NET_2_0 + public abstract class DbDataAdapter : DataAdapter, IDbDataAdapter, IDataAdapter, ICloneable +#else public abstract class DbDataAdapter : DataAdapter, ICloneable +#endif { #region Fields @@ -77,9 +81,6 @@ namespace System.Data.Common { } #endif - IDbCommand DeleteCommand { - get { return ((IDbDataAdapter) this).DeleteCommand; } - } #if NET_2_0 protected internal CommandBehavior FillCommandBehavior { @@ -88,9 +89,6 @@ namespace System.Data.Common { } #endif - IDbCommand InsertCommand { - get { return ((IDbDataAdapter) this).InsertCommand; } - } #if NET_2_0 [MonoTODO] @@ -99,16 +97,59 @@ namespace System.Data.Common { set { throw new NotImplementedException (); } } + [MonoTODO] protected virtual DbProviderFactory ProviderFactory { get { throw new NotImplementedException (); } } -#endif - IDbCommand SelectCommand { - get { return ((IDbDataAdapter) this).SelectCommand; } + [MonoTODO] + IDbCommand IDbDataAdapter.SelectCommand { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + [MonoTODO] + IDbCommand IDbDataAdapter.UpdateCommand{ + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + [MonoTODO] + IDbCommand IDbDataAdapter.DeleteCommand{ + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + [MonoTODO] + IDbCommand IDbDataAdapter.InsertCommand{ + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + [MonoTODO] + public DbCommand SelectCommand { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + [MonoTODO] + public DbCommand DeleteCommand { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + [MonoTODO] + public DbCommand InsertCommand { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + [MonoTODO] + public DbCommand UpdateCommand { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } } -#if NET_2_0 [MonoTODO] public IDbTransaction Transaction { get { throw new NotImplementedException (); } @@ -120,12 +161,24 @@ namespace System.Data.Common { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } } -#endif +#else + IDbCommand SelectCommand { + get { return ((IDbDataAdapter) this).SelectCommand; } + } IDbCommand UpdateCommand { get { return ((IDbDataAdapter) this).UpdateCommand; } } + IDbCommand DeleteCommand { + get { return ((IDbDataAdapter) this).DeleteCommand; } + } + + IDbCommand InsertCommand { + get { return ((IDbDataAdapter) this).InsertCommand; } + } +#endif + #endregion // Properties #region Events diff --git a/mcs/class/System.Data/System.Data.Common/DbDataReader.cs b/mcs/class/System.Data/System.Data.Common/DbDataReader.cs index 68a137ba041..03a35de427c 100644 --- a/mcs/class/System.Data/System.Data.Common/DbDataReader.cs +++ b/mcs/class/System.Data/System.Data.Common/DbDataReader.cs @@ -64,13 +64,21 @@ namespace System.Data.Common { #region Methods public abstract void Close (); - public abstract void Dispose (); public abstract bool GetBoolean (int i); public abstract byte GetByte (int i); public abstract long GetBytes (int i, long fieldOffset, byte[] buffer, int bufferOffset, int length); public abstract char GetChar (int i); public abstract long GetChars (int i, long dataIndex, char[] buffer, int bufferIndex, int length); - + public virtual void Dispose () + { + Dispose (true); + } + + [MonoTODO] + protected virtual void Dispose (bool disposing) + { + throw new NotImplementedException (); + } #if NET_2_0 [MonoTODO] public DbDataReader GetData (int i) @@ -84,9 +92,6 @@ namespace System.Data.Common { public abstract decimal GetDecimal (int i); public abstract double GetDouble (int i); public abstract IEnumerator GetEnumerator (); -#if NET_2_0 - public abstract Type GetFieldProviderSpecificType (int i); -#endif public abstract Type GetFieldType (int i); public abstract float GetFloat (int i); public abstract Guid GetGuid (int i); @@ -97,9 +102,30 @@ namespace System.Data.Common { public abstract int GetOrdinal (string name); #if NET_2_0 - public abstract object GetProviderSpecificValue (int i); - public abstract int GetProviderSpecificValues (object[] values); -#endif + [MonoTODO] + public virtual Type GetProviderSpecificFieldType (int i) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual object GetProviderSpecificValue (int i) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual int GetProviderSpecificValues (object[] values) + { + throw new NotImplementedException (); + } + + [MonoTODO] + public virtual int GetDbDataReader (int ordinal) + { + throw new NotImplementedException (); + } +#endif public abstract DataTable GetSchemaTable (); public abstract string GetString (int i); diff --git a/mcs/class/System.Data/System.Data.Common/DbException.cs b/mcs/class/System.Data/System.Data.Common/DbException.cs index 52b6b99efa9..b5e41618192 100644 --- a/mcs/class/System.Data/System.Data.Common/DbException.cs +++ b/mcs/class/System.Data/System.Data.Common/DbException.cs @@ -33,7 +33,7 @@ using System.Globalization; using System.Runtime.Serialization; using System.Runtime.InteropServices; -namespace System.Data { +namespace System.Data.Common { [Serializable] public abstract class DbException : ExternalException { diff --git a/mcs/class/System.Data/System.Data.Common/DbMetaDataCollectionNames.cs b/mcs/class/System.Data/System.Data.Common/DbMetaDataCollectionNames.cs new file mode 100644 index 00000000000..27a876518e2 --- /dev/null +++ b/mcs/class/System.Data/System.Data.Common/DbMetaDataCollectionNames.cs @@ -0,0 +1,40 @@ +// System.Data.Common.DbMetaDataCollectionNames +// +// Author: Senganal T (tsenganal@novell.com) +// +// (C) Senganal T 2005 + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +#if NET_2_0 +namespace System.Data.Common { + [MonoTODO] + public static class DbMetaDataCollectionNames { + + public static readonly string DataSourceInformation = "DataSourceInformation"; + public static readonly string DataTypes = "DataTypes" ; + public static readonly string MetaDataCollections = "MetaDataCollections"; + public static readonly string ReservedWords = "ReservedWords"; + public static readonly string Restrictions = "Restrictions"; + } +} +#endif diff --git a/mcs/class/System.Data/System.Data.Common/DbParameter.cs b/mcs/class/System.Data/System.Data.Common/DbParameter.cs index 3546eb54e80..ba3352def50 100644 --- a/mcs/class/System.Data/System.Data.Common/DbParameter.cs +++ b/mcs/class/System.Data/System.Data.Common/DbParameter.cs @@ -54,7 +54,6 @@ namespace System.Data.Common { public abstract int Size { get; set; } public abstract object Value { get; set; } public abstract bool IsNullable { get; set; } - public abstract int Offset { get; set; } public abstract string SourceColumn { get; set; } public abstract DataRowVersion SourceVersion { get; set; } @@ -62,12 +61,10 @@ namespace System.Data.Common { #region Methods - public abstract void CopyTo (DbParameter destination); - #if NET_2_0 + public abstract bool SourceColumnNullMapping { get; set; } public abstract void ResetDbType (); #endif - #endregion // Methods } } diff --git a/mcs/class/System.Data/System.Data.Common/DbParameterCollection.cs b/mcs/class/System.Data/System.Data.Common/DbParameterCollection.cs index 8f940f19db5..c946ef382d4 100644 --- a/mcs/class/System.Data/System.Data.Common/DbParameterCollection.cs +++ b/mcs/class/System.Data/System.Data.Common/DbParameterCollection.cs @@ -91,7 +91,9 @@ namespace System.Data.Common { #if NET_2_0 public abstract void AddRange (Array values); - protected abstract int CheckName (string parameterName); + protected abstract DbParameter GetParameter (String parameterName); + protected abstract void SetParameter (String parameterName, + DbParameter value); #endif public abstract void Clear (); diff --git a/mcs/class/System.Data/System.Data.Common/DbProviderFactories.cs b/mcs/class/System.Data/System.Data.Common/DbProviderFactories.cs index c0e8dfb8ca9..339d2767c3e 100644 --- a/mcs/class/System.Data/System.Data.Common/DbProviderFactories.cs +++ b/mcs/class/System.Data/System.Data.Common/DbProviderFactories.cs @@ -39,19 +39,13 @@ using System.Collections; using System.Configuration; namespace System.Data.Common { - public sealed class DbProviderFactories + public static class DbProviderFactories { private static object configEntries = null; // DataSet private const string CONFIG_SECTION_NAME = "system.data"; private const string CONFIG_SEC_TABLE_NAME = "DbProviderFactories"; - #region Constructors - private DbProviderFactories () - { - } - #endregion Constructors - #region Methods public static DbProviderFactory GetFactory (DataRow providerRow) diff --git a/mcs/class/System.Data/System.Data.Common/DbProviderFactory.cs b/mcs/class/System.Data/System.Data.Common/DbProviderFactory.cs index be5f493bd94..f8a7d56fecd 100644 --- a/mcs/class/System.Data/System.Data.Common/DbProviderFactory.cs +++ b/mcs/class/System.Data/System.Data.Common/DbProviderFactory.cs @@ -54,7 +54,10 @@ namespace System.Data.Common { #region Properties - public abstract DbProviderSupportedClasses SupportedClasses { get; } + [MonoTODO] + public virtual bool CanCreateDataSourceEnumerator { + get {throw new NotImplementedException ();} + } #endregion // Properties #region Methods @@ -113,7 +116,12 @@ namespace System.Data.Common { throw new NotImplementedException (); } - + [MonoTODO] + public virtual DbConnectionStringBuilder CreateConnectionStringBuilder () + { + throw new NotImplementedException (); + } + #endregion // Methods } } diff --git a/mcs/class/System.Data/System.Data.Common/DbTable.cs b/mcs/class/System.Data/System.Data.Common/DbTable.cs index 69666b15787..b4ae7dfb28d 100644 --- a/mcs/class/System.Data/System.Data.Common/DbTable.cs +++ b/mcs/class/System.Data/System.Data.Common/DbTable.cs @@ -49,7 +49,7 @@ namespace System.Data.Common { #region Properties [MonoTODO] - public ConflictOptions ConflictDetection { + public ConflictOption ConflictOption { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } } diff --git a/mcs/class/System.Data/System.Data.Common/DbTransaction.cs b/mcs/class/System.Data/System.Data.Common/DbTransaction.cs index 0c9d3dc1f46..6a586aa0439 100644 --- a/mcs/class/System.Data/System.Data.Common/DbTransaction.cs +++ b/mcs/class/System.Data/System.Data.Common/DbTransaction.cs @@ -1,4 +1,4 @@ -// + // System.Data.Common.DbTransaction.cs // // Author: @@ -63,9 +63,18 @@ namespace System.Data.Common { #region Methods public abstract void Commit (); - public abstract void Dispose (); public abstract void Rollback (); + public virtual void Dispose () + { + Dispose (true); + } + + protected virtual void Dispose (bool disposing) + { + throw new NotImplementedException (); + } + #endregion // Methods } } |