Exemplo n.º 1
0
 internal void SetInnerConnectionTo(DbConnectionInternal to)
 {
     Debug.Assert(null != _innerConnection, "null InnerConnection");
     Debug.Assert(null != to, "to null InnerConnection");
     _innerConnection = to;
 }
Exemplo n.º 2
0
 internal void SetInnerConnectionTo(DbConnectionInternal to)
 {
     this._innerConnection = to;
 }
Exemplo n.º 3
0
 /// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml' path='docs/members[@name="SqlConnection"]/ctor2/*' />
 public SqlConnection() : base()
 {
     GC.SuppressFinalize(this);
     _innerConnection = DbConnectionClosedNeverOpened.SingletonInstance;
 }
Exemplo n.º 4
0
 public OleDbConnection()
 {
     this.ObjectID = Interlocked.Increment(ref _objectTypeCount);
     GC.SuppressFinalize(this);
     this._innerConnection = DbConnectionClosedNeverOpened.SingletonInstance;
 }
Exemplo n.º 5
0
 internal bool SetInnerConnectionFrom(DbConnectionInternal to, DbConnectionInternal from)
 {
     return(from == Interlocked.CompareExchange <DbConnectionInternal>(ref this._innerConnection, to, from));
 }
Exemplo n.º 6
0
 protected override IAsyncResult BeginCreateConnection (DbConnectionBase owningObject, DbConnectionString connectionOptions, DbConnectionInternal connection, AsyncCallback callback, object asyncStateObject)
 {
         throw new NotImplementedException ();
 }
Exemplo n.º 7
0
 internal override void SetInnerConnectionTo(DbConnection owningObject, DbConnectionInternal to)
 {
     (owningObject as OdbcConnection)?.SetInnerConnectionTo(to);
 }
Exemplo n.º 8
0
 protected override IAsyncResult BeginCreateConnection(DbConnectionBase owningObject, DbConnectionString connectionOptions, DbConnectionInternal connection, AsyncCallback callback, object asyncStateObject)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 9
0
        private OleDbConnectionInternal GetOpenConnection()
        {
            DbConnectionInternal innerConnection = InnerConnection;

            return((innerConnection as OleDbConnectionInternal) !);
        }
Exemplo n.º 10
0
 protected override DbMetaDataFactory CreateMetaDataFactory(DbConnectionInternal internalConnection)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 11
0
 protected internal new DbMetaDataFactory GetMetaDataFactory(DbConnectionString connectionOptions, DbConnectionInternal internalConnection)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 12
0
 public CONNECTIONOBJECTNAME() : base()
 {
     GC.SuppressFinalize(this);
     _innerConnection = DbConnectionClosedNeverOpened.SingletonInstance;
 }
Exemplo n.º 13
0
        override protected DbMetaDataFactory CreateMetaDataFactory(DbConnectionInternal internalConnection, out bool cacheMetaDataFactory)
        {
            Debug.Assert(internalConnection != null, "internalConnection may not be null.");
            cacheMetaDataFactory = false;

            OdbcConnection odbcOuterConnection = ((OdbcConnectionOpen)internalConnection).OuterConnection;

            Debug.Assert(odbcOuterConnection != null, "outer connection may not be null.");

            NameValueCollection settings = (NameValueCollection)PrivilegedConfigurationManager.GetSection("system.data.odbc");
            Stream XMLStream             = null;

            // get the DBMS Name
            object driverName  = null;
            string stringValue = odbcOuterConnection.GetInfoStringUnhandled(ODBC32.SQL_INFO.DRIVER_NAME);

            if (stringValue != null)
            {
                driverName = stringValue;
            }

            if (settings != null)
            {
                string[] values      = null;
                string   metaDataXML = null;
                // first try to get the provider specific xml

                // if driver name is not supported we can't build the settings key needed to
                // get the provider specific XML path
                if (driverName != null)
                {
                    metaDataXML = ((string)driverName) + _MetaData;
                    values      = settings.GetValues(metaDataXML);
                }

                // if we did not find provider specific xml see if there is new default xml
                if (values == null)
                {
                    metaDataXML = _defaultMetaDataXml;
                    values      = settings.GetValues(metaDataXML);
                }

                // If there is an XML file get it
                if (values != null)
                {
                    XMLStream = ADP.GetXmlStreamFromValues(values, metaDataXML);
                }
            }

            // use the embedded xml if the user did not over ride it
            if (XMLStream == null)
            {
                XMLStream            = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("System.Data.Odbc.OdbcMetaData.xml");
                cacheMetaDataFactory = true;
            }

            Debug.Assert(XMLStream != null, "XMLstream may not be null.");

            String versionString = odbcOuterConnection.GetInfoStringUnhandled(ODBC32.SQL_INFO.DBMS_VER);

            return(new OdbcMetaDataFactory(XMLStream,
                                           versionString,
                                           versionString,
                                           odbcOuterConnection));
        }
        internal override bool SetInnerConnectionFrom(DbConnection owningObject, DbConnectionInternal to, DbConnectionInternal from)
        {
            OleDbConnection connection = owningObject as OleDbConnection;

            return((connection != null) && connection.SetInnerConnectionFrom(to, from));
        }
Exemplo n.º 15
0
        override internal bool SetInnerConnectionFrom(DbConnection owningObject, DbConnectionInternal to, DbConnectionInternal from)
        {
            SqlConnection c = (owningObject as SqlConnection);

            if (null != c)
            {
                return(c.SetInnerConnectionFrom(to, from));
            }
            return(false);
        }
Exemplo n.º 16
0
 private DbMetaDataFactory GetMetaDataFactory(DbConnectionInternal internalConnection)
 {
     return(this.ConnectionFactory.GetMetaDataFactory(this._poolGroup, internalConnection));
 }
Exemplo n.º 17
0
 protected internal new DbMetaDataFactory GetMetaDataFactory (DbConnectionString connectionOptions, DbConnectionInternal internalConnection)
 {
         throw new NotImplementedException ();
 }
Exemplo n.º 18
0
 internal DbMetaDataFactory GetMetaDataFactoryInternal(DbConnectionInternal internalConnection)
 {
     return(this.GetMetaDataFactory(internalConnection));
 }
Exemplo n.º 19
0
 protected override DbMetaDataFactory CreateMetaDataFactory (DbConnectionInternal internalConnection)
 {
         throw new NotImplementedException ();
 }
Exemplo n.º 20
0
 internal override void SetInnerConnectionEvent(DbConnection owningObject, DbConnectionInternal to)
 {
     (owningObject as OleDbConnection)?.SetInnerConnectionEvent(to);
 }