Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Data / System / Data / Odbc / OdbcEnvironmentHandle.cs / 1 / OdbcEnvironmentHandle.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Data.Common; using System.Diagnostics; using System.Globalization; using System.Runtime.InteropServices; using System.Security; using System.Security.Permissions; using System.Text; using System.Threading; namespace System.Data.Odbc { sealed internal class OdbcEnvironmentHandle : OdbcHandle { internal OdbcEnvironmentHandle() : base(ODBC32.SQL_HANDLE.ENV, null) { ODBC32.RetCode retcode; //Set the expected driver manager version // retcode = UnsafeNativeMethods.SQLSetEnvAttr( this, ODBC32.SQL_ATTR.ODBC_VERSION, ODBC32.SQL_OV_ODBC3, ODBC32.SQL_IS.INTEGER); // ignore retcode //Turn on connection pooling //Note: the env handle controls pooling. Only those connections created under that //handle are pooled. So we have to keep it alive and not create a new environment //for every connection. // retcode = UnsafeNativeMethods.SQLSetEnvAttr( this, ODBC32.SQL_ATTR.CONNECTION_POOLING, ODBC32.SQL_CP_ONE_PER_HENV, ODBC32.SQL_IS.INTEGER); switch(retcode) { case ODBC32.RetCode.SUCCESS: case ODBC32.RetCode.SUCCESS_WITH_INFO: break; default: Dispose(); throw ODBC.CantEnableConnectionpooling(retcode); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Data.Common; using System.Diagnostics; using System.Globalization; using System.Runtime.InteropServices; using System.Security; using System.Security.Permissions; using System.Text; using System.Threading; namespace System.Data.Odbc { sealed internal class OdbcEnvironmentHandle : OdbcHandle { internal OdbcEnvironmentHandle() : base(ODBC32.SQL_HANDLE.ENV, null) { ODBC32.RetCode retcode; //Set the expected driver manager version // retcode = UnsafeNativeMethods.SQLSetEnvAttr( this, ODBC32.SQL_ATTR.ODBC_VERSION, ODBC32.SQL_OV_ODBC3, ODBC32.SQL_IS.INTEGER); // ignore retcode //Turn on connection pooling //Note: the env handle controls pooling. Only those connections created under that //handle are pooled. So we have to keep it alive and not create a new environment //for every connection. // retcode = UnsafeNativeMethods.SQLSetEnvAttr( this, ODBC32.SQL_ATTR.CONNECTION_POOLING, ODBC32.SQL_CP_ONE_PER_HENV, ODBC32.SQL_IS.INTEGER); switch(retcode) { case ODBC32.RetCode.SUCCESS: case ODBC32.RetCode.SUCCESS_WITH_INFO: break; default: Dispose(); throw ODBC.CantEnableConnectionpooling(retcode); } } } } // 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
- SmiEventSink_Default.cs
- XmlUtil.cs
- Crypto.cs
- DynamicPropertyHolder.cs
- CommandPlan.cs
- Boolean.cs
- Select.cs
- ApplicationId.cs
- DetailsViewInsertEventArgs.cs
- XmlUtil.cs
- CngAlgorithm.cs
- externdll.cs
- OutputCacheSection.cs
- BCryptNative.cs
- SchemaImporterExtensionElement.cs
- BuildProvider.cs
- Exceptions.cs
- XmlSchemaAny.cs
- Pair.cs
- ToolStripContentPanelRenderEventArgs.cs
- ProvidePropertyAttribute.cs
- PropertyPushdownHelper.cs
- DoubleAnimation.cs
- WebPartRestoreVerb.cs
- sqlnorm.cs
- Rotation3DAnimationUsingKeyFrames.cs
- OdbcReferenceCollection.cs
- NewArray.cs
- MailAddressCollection.cs
- StackSpiller.Temps.cs
- StorageRoot.cs
- TdsParserHelperClasses.cs
- SessionEndingEventArgs.cs
- AtlasWeb.Designer.cs
- Transform.cs
- XmlSchemaSet.cs
- PagedControl.cs
- Helpers.cs
- ConfigurationSection.cs
- ReliableChannelFactory.cs
- IdentityHolder.cs
- DrawTreeNodeEventArgs.cs
- SpeechSynthesizer.cs
- RestHandlerFactory.cs
- BinaryEditor.cs
- ValidationSummary.cs
- DesignBindingPropertyDescriptor.cs
- DispatcherProcessingDisabled.cs
- DefaultPrintController.cs
- SqlInternalConnectionTds.cs
- ActivityValidationServices.cs
- ResponseStream.cs
- AmbiguousMatchException.cs
- HWStack.cs
- Positioning.cs
- DocumentsTrace.cs
- AvtEvent.cs
- ProxyElement.cs
- ClosableStream.cs
- XmlSerializerVersionAttribute.cs
- SubMenuStyle.cs
- CodeAccessPermission.cs
- Helpers.cs
- XmlQueryRuntime.cs
- LinqDataSourceDeleteEventArgs.cs
- XpsImage.cs
- Operand.cs
- XmlProcessingInstruction.cs
- DataGridViewCheckBoxColumn.cs
- DataProtection.cs
- ModelService.cs
- DrawingContextDrawingContextWalker.cs
- nulltextnavigator.cs
- ToolStripItemRenderEventArgs.cs
- DataGridItemAutomationPeer.cs
- SystemParameters.cs
- RightNameExpirationInfoPair.cs
- FileSecurity.cs
- TcpProcessProtocolHandler.cs
- SafeHandles.cs
- InstanceData.cs
- PictureBox.cs
- FunctionParameter.cs
- MsmqMessageProperty.cs
- ActivityCodeDomSerializationManager.cs
- PersonalizationProviderHelper.cs
- AuthorizationSection.cs
- UnsafeNativeMethods.cs
- DrawToolTipEventArgs.cs
- TypeElement.cs
- processwaithandle.cs
- UnsafeNativeMethods.cs
- RequestCachePolicy.cs
- CachedTypeface.cs
- ChildrenQuery.cs
- TimerElapsedEvenArgs.cs
- ScalarConstant.cs
- HandlerMappingMemo.cs
- Repeater.cs
- ValueChangedEventManager.cs