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
- ScriptingRoleServiceSection.cs
- DataTableTypeConverter.cs
- LogEntrySerializationException.cs
- CompoundFileReference.cs
- SamlAudienceRestrictionCondition.cs
- DataGridRow.cs
- GridItemPattern.cs
- XmlSchemaObject.cs
- BinaryObjectReader.cs
- XmlDataLoader.cs
- SecurityUtils.cs
- tooltip.cs
- DbConnectionPool.cs
- IMembershipProvider.cs
- StrokeCollectionDefaultValueFactory.cs
- odbcmetadatafactory.cs
- BitmapSource.cs
- DateTimeOffset.cs
- ImpersonateTokenRef.cs
- HostedTcpTransportManager.cs
- DatePicker.cs
- CompileXomlTask.cs
- X509CertificateStore.cs
- PageParserFilter.cs
- WebPartDisplayMode.cs
- SendParametersContent.cs
- Image.cs
- CheckBox.cs
- ScriptHandlerFactory.cs
- IODescriptionAttribute.cs
- diagnosticsswitches.cs
- SizeAnimationClockResource.cs
- XPathNavigatorKeyComparer.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- PassportAuthenticationModule.cs
- HexParser.cs
- ScrollBarRenderer.cs
- TextPenaltyModule.cs
- ActionFrame.cs
- XmlReflectionImporter.cs
- StrokeCollection.cs
- DeploymentSectionCache.cs
- HashCryptoHandle.cs
- TableHeaderCell.cs
- CompilerInfo.cs
- InstanceStoreQueryResult.cs
- HtmlContainerControl.cs
- StrokeNodeData.cs
- PtsHelper.cs
- SoapHeaderException.cs
- SchemaMapping.cs
- InitializerFacet.cs
- ObjectListDataBindEventArgs.cs
- FileRecordSequenceHelper.cs
- MaskInputRejectedEventArgs.cs
- TypeElement.cs
- ServiceParser.cs
- complextypematerializer.cs
- DefaultTextStore.cs
- NullRuntimeConfig.cs
- SignedXml.cs
- Double.cs
- ByteAnimation.cs
- SourceElementsCollection.cs
- XmlHierarchicalEnumerable.cs
- HtmlTable.cs
- HMACRIPEMD160.cs
- PassportAuthenticationEventArgs.cs
- WorkerRequest.cs
- SecurityKeyIdentifier.cs
- UnsignedPublishLicense.cs
- AutomationPropertyInfo.cs
- TaskHelper.cs
- ReachDocumentReferenceCollectionSerializerAsync.cs
- PolyBezierSegment.cs
- InvokeWebService.cs
- UIAgentMonitorHandle.cs
- CategoryAttribute.cs
- WindowsHyperlink.cs
- DragEventArgs.cs
- BaseCollection.cs
- cache.cs
- ClientType.cs
- DataRelationCollection.cs
- Package.cs
- LinearGradientBrush.cs
- RelationshipWrapper.cs
- CodeGen.cs
- ModelEditingScope.cs
- SystemWebCachingSectionGroup.cs
- Sql8ConformanceChecker.cs
- TemplateBamlRecordReader.cs
- HostedElements.cs
- FixedPosition.cs
- PartialCachingAttribute.cs
- CellPartitioner.cs
- LocatorPart.cs
- PreviewControlDesigner.cs
- EDesignUtil.cs
- HtmlTitle.cs