[corlib] Fixes security tests failures
[mono.git] / mcs / class / System.Data / System.Data.OleDb / OleDbConnection.cs
index 626657057f83140a233b9657012677da3e6c2dea..eb22eae2c7c00119571df5062e239260d61a6c76 100644 (file)
@@ -36,18 +36,12 @@ using System.ComponentModel;
 using System.Data;
 using System.Data.Common;
 using System.EnterpriseServices;
-#if NET_2_0
 using System.Transactions;
-#endif
 
 namespace System.Data.OleDb
 {
        [DefaultEvent ("InfoMessage")]
-#if NET_2_0
        public sealed class OleDbConnection : DbConnection, ICloneable
-#else
-       public sealed class OleDbConnection : Component, ICloneable, IDbConnection
-#endif
        {
                #region Fields
 
@@ -76,17 +70,10 @@ namespace System.Data.OleDb
                
                [DataCategory ("Data")]
                [DefaultValue ("")]
-#if NET_1_0 || ONLY_1_1
-               [DataSysDescriptionAttribute ("Information used to connect to a Data Source.")]
-#endif
                [EditorAttribute ("Microsoft.VSDesigner.Data.ADO.Design.OleDbConnectionStringEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
                [RecommendedAsConfigurable (true)]
                [RefreshPropertiesAttribute (RefreshProperties.All)]
-               public
-#if NET_2_0
-               override
-#endif
-               string ConnectionString {
+               public override string ConnectionString {
                        get {
                                if (connectionString == null)
                                        return string.Empty;
@@ -98,27 +85,14 @@ namespace System.Data.OleDb
                }
 
                [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-#if !NET_2_0
-               [DataSysDescriptionAttribute ("Current connection timeout value, 'Connect Timeout=X' in the ConnectionString.")]
-#endif
-               public
-#if NET_2_0
-               override
-#endif
-               int ConnectionTimeout {
+               public override int ConnectionTimeout {
                        get {
                                return connectionTimeout;
                        }
                }
 
                [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-#if !NET_2_0
-               [DataSysDescriptionAttribute ("Current data source catalog value, 'Initial Catalog=X' in the connection string.")]
-#endif
-               public
-#if NET_2_0
-               override
-#endif
+               public override 
                string Database {
                        get {
                                if (gdaConnection != IntPtr.Zero
@@ -130,17 +104,8 @@ namespace System.Data.OleDb
                        }
                }
 
-#if NET_2_0
                [BrowsableAttribute (true)]
-#else
-               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-               [DataSysDescriptionAttribute ("Current data source, 'Data Source=X' in the connection string.")]
-#endif
-               public
-#if NET_2_0
-               override
-#endif
-               string DataSource {
+               public override string DataSource {
                        get {
                                if (gdaConnection != IntPtr.Zero
                                        && libgda.gda_connection_is_open (gdaConnection)) {
@@ -152,11 +117,7 @@ namespace System.Data.OleDb
                }
 
                [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-#if NET_2_0
                [BrowsableAttribute (true)]
-#else
-               [DataSysDescriptionAttribute ("Current OLE DB provider progid, 'Provider=X' in the connection string.")]
-#endif
                public string Provider {
                        get {
                                if (gdaConnection != IntPtr.Zero
@@ -168,16 +129,7 @@ namespace System.Data.OleDb
                        }
                }
 
-#if !NET_2_0
-               [DataSysDescriptionAttribute ("Version of the product accessed by the OLE DB Provider.")]
-               [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-               [BrowsableAttribute (false)]
-#endif
-               public
-#if NET_2_0
-               override
-#endif
-               string ServerVersion {
+               public override string ServerVersion {
                        get {
                                if (State == ConnectionState.Closed)
                                        throw ExceptionHelper.ConnectionClosed ();
@@ -186,15 +138,8 @@ namespace System.Data.OleDb
                }
 
                [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-#if !NET_2_0
-               [DataSysDescriptionAttribute ("The ConnectionState indicating whether the connection is open or closed.")]
-#endif
                [BrowsableAttribute (false)]
-               public
-#if NET_2_0
-               override
-#endif
-               ConnectionState State {
+               public override ConnectionState State {
                        get {
                                if (gdaConnection != IntPtr.Zero) {
                                        if (libgda.gda_connection_is_open (gdaConnection))
@@ -229,7 +174,6 @@ namespace System.Data.OleDb
                        return new OleDbTransaction (this, isolationLevel);
                }
 
-#if NET_2_0
                protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel)
                {
                        return BeginTransaction (isolationLevel);
@@ -239,28 +183,8 @@ namespace System.Data.OleDb
                {
                        return CreateCommand ();
                }
-#else
-               IDbTransaction IDbConnection.BeginTransaction ()
-               {
-                       return BeginTransaction ();
-               }
-
-               IDbTransaction IDbConnection.BeginTransaction (IsolationLevel isolationLevel)
-               {
-                       return BeginTransaction (isolationLevel);
-               }
-
-               IDbCommand IDbConnection.CreateCommand ()
-               {
-                       return CreateCommand ();
-               }
-#endif
 
-               public
-#if NET_2_0
-               override
-#endif
-               void ChangeDatabase (string value)
+               public override void ChangeDatabase (string value)
                {
                        if (State != ConnectionState.Open)
                                throw new InvalidOperationException ();
@@ -269,11 +193,7 @@ namespace System.Data.OleDb
                                throw new OleDbException (this);
                }
 
-               public
-#if NET_2_0
-               override
-#endif
-               void Close ()
+               public override void Close ()
                {
                        if (State == ConnectionState.Open) {
                                libgda.gda_connection_close (gdaConnection);
@@ -308,16 +228,14 @@ namespace System.Data.OleDb
                }
 
                public
-#if NET_2_0
                override
-#endif
                void Open ()
                {
-                       string provider = "Default";
-                       string gdaCncStr = string.Empty;
-                       string[] args;
-                       int len;
-                       char [] separator = { ';' };
+//                     string provider = "Default";
+//                     string gdaCncStr = string.Empty;
+//                     string[] args;
+//                     int len;
+//                     char [] separator = { ';' };
                        
                        if (State == ConnectionState.Open)
                                throw new InvalidOperationException ();
@@ -378,7 +296,6 @@ namespace System.Data.OleDb
                        throw new NotImplementedException ();
                }
 
-#if NET_2_0
                [MonoTODO]
                public override void EnlistTransaction (Transaction transaction)
                {
@@ -413,23 +330,14 @@ namespace System.Data.OleDb
                {
                        throw new NotImplementedException ();
                }
-#endif
 
                #endregion
 
                #region Events and Delegates
 
-#if !NET_2_0
-               [DataSysDescription ("Event triggered when messages arrive from the DataSource.")]
-#endif
                [DataCategory ("DataCategory_InfoMessage")]
                public event OleDbInfoMessageEventHandler InfoMessage;
 
-#if !NET_2_0
-               [DataSysDescription ("Event triggered when the connection changes state.")]
-               [DataCategory ("DataCategory_StateChange")]
-               public event StateChangeEventHandler StateChange;
-#endif
 
                #endregion
        }