Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / Odbc / OdbcConnectionOpen.cs / 1305376 / OdbcConnectionOpen.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- using System; using System.Data; using System.Data.Common; using System.Data.ProviderBase; using System.Threading; using SysTx = System.Transactions; namespace System.Data.Odbc { sealed internal class OdbcConnectionOpen : DbConnectionInternal { // Construct from a compiled connection string internal OdbcConnectionOpen(OdbcConnection outerConnection, OdbcConnectionString connectionOptions) { #if DEBUG try { // use this to help validate this object is only created after the following permission has been previously demanded in the current codepath if (null != outerConnection) { outerConnection.UserConnectionOptions.DemandPermission(); } else { connectionOptions.DemandPermission(); } } catch(System.Security.SecurityException) { System.Diagnostics.Debug.Assert(false, "unexpected SecurityException for current codepath"); throw; } #endif OdbcEnvironmentHandle environmentHandle = OdbcEnvironment.GetGlobalEnvironmentHandle(); outerConnection.ConnectionHandle = new OdbcConnectionHandle(outerConnection, connectionOptions, environmentHandle); } internal OdbcConnection OuterConnection { get { OdbcConnection outerConnection = (OdbcConnection)Owner; if (null == outerConnection) throw ADP.InvalidOperation("internal connection without an outer connection?"); // return outerConnection; } } override public string ServerVersion { get { return OuterConnection.Open_GetServerVersion(); } } override protected void Activate(SysTx.Transaction transaction) { OdbcConnection.ExecutePermission.Demand(); } override public DbTransaction BeginTransaction(IsolationLevel isolevel) { return BeginOdbcTransaction(isolevel); } internal OdbcTransaction BeginOdbcTransaction(IsolationLevel isolevel) { return OuterConnection.Open_BeginTransaction(isolevel); } override public void ChangeDatabase(string value) { OuterConnection.Open_ChangeDatabase(value); } override protected DbReferenceCollection CreateReferenceCollection() { return new OdbcReferenceCollection(); } override protected void Deactivate() { NotifyWeakReference(OdbcReferenceCollection.Closing); } override public void EnlistTransaction(SysTx.Transaction transaction) { OuterConnection.Open_EnlistTransaction(transaction); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SQLMoney.cs
- HtmlToClrEventProxy.cs
- Int32.cs
- X509CertificateCollection.cs
- CallContext.cs
- SmtpNegotiateAuthenticationModule.cs
- DragEventArgs.cs
- XmlWrappingReader.cs
- ListBoxChrome.cs
- SimpleApplicationHost.cs
- TaskFormBase.cs
- HtmlFormWrapper.cs
- TrackingExtract.cs
- StylusLogic.cs
- PerfProviderCollection.cs
- DataGridParentRows.cs
- DataServiceResponse.cs
- WeakEventTable.cs
- AssemblyHash.cs
- TransactionProtocol.cs
- CodeSubDirectoriesCollection.cs
- DataBindEngine.cs
- X509ChainElement.cs
- DeviceSpecificChoiceCollection.cs
- InternalMappingException.cs
- RedistVersionInfo.cs
- TdsValueSetter.cs
- DataGridHeaderBorder.cs
- EventLogEntry.cs
- FixedSOMPageConstructor.cs
- DataTableNewRowEvent.cs
- NativeMethods.cs
- BackgroundWorker.cs
- Matrix3D.cs
- QilPatternVisitor.cs
- XMLSyntaxException.cs
- FileRegion.cs
- CompressionTracing.cs
- CodeObject.cs
- EndPoint.cs
- MediaElement.cs
- NavigationCommands.cs
- SystemIPInterfaceProperties.cs
- SoapHeader.cs
- CodeAccessPermission.cs
- SchemaImporterExtensionElement.cs
- ForeignConstraint.cs
- IUnknownConstantAttribute.cs
- SqlBulkCopyColumnMapping.cs
- OptimizerPatterns.cs
- ConnectionPointCookie.cs
- WebPartMenuStyle.cs
- HttpCapabilitiesBase.cs
- HtmlTableCellCollection.cs
- odbcmetadatacollectionnames.cs
- PasswordBox.cs
- InfoCardClaimCollection.cs
- login.cs
- QilInvoke.cs
- PassportAuthenticationEventArgs.cs
- OptimizedTemplateContentHelper.cs
- IdentitySection.cs
- GridPattern.cs
- EdmPropertyAttribute.cs
- PersonalizationDictionary.cs
- DataColumnChangeEvent.cs
- XmlElementList.cs
- EmptyStringExpandableObjectConverter.cs
- TargetControlTypeCache.cs
- TransportBindingElement.cs
- CompatibleIComparer.cs
- ScriptControlManager.cs
- CodeSnippetExpression.cs
- CommonProperties.cs
- BezierSegment.cs
- ObjectHandle.cs
- TraceEventCache.cs
- NativeCppClassAttribute.cs
- HtmlTableRow.cs
- WebException.cs
- XmlIlTypeHelper.cs
- StylusEventArgs.cs
- StyleSelector.cs
- ListDictionary.cs
- TextUtf8RawTextWriter.cs
- RuntimeArgumentHandle.cs
- SqlProviderUtilities.cs
- DataServiceOperationContext.cs
- ExtenderControl.cs
- MimeWriter.cs
- TypeToken.cs
- TreeChangeInfo.cs
- ProfessionalColors.cs
- OleDbReferenceCollection.cs
- ToolboxCategoryItems.cs
- EnumDataContract.cs
- LockedHandleGlyph.cs
- FilterException.cs
- OracleTimeSpan.cs
- DataListCommandEventArgs.cs