Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / Odbc / OdbcEnvironmentHandle.cs / 1305376 / 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; using System.Runtime.Versioning; namespace System.Data.Odbc { sealed internal class OdbcEnvironmentHandle : OdbcHandle { // SxS: this method uses SQLSetEnvAttr to setup ODBC environment handle settings. Environment handle is safe in SxS. [ResourceExposure(ResourceScope.None)] [ResourceConsumption(ResourceScope.Process, ResourceScope.Process)] 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
- TrustSection.cs
- CapabilitiesState.cs
- UnaryQueryOperator.cs
- SqlPersistenceProviderFactory.cs
- ManifestResourceInfo.cs
- ComponentSerializationService.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- RewritingProcessor.cs
- XsdBuildProvider.cs
- RelationshipNavigation.cs
- DispatchWrapper.cs
- DeadCharTextComposition.cs
- EntityDataSourceReferenceGroup.cs
- _DynamicWinsockMethods.cs
- PointConverter.cs
- AccessDataSource.cs
- XPathBinder.cs
- InvalidOleVariantTypeException.cs
- _UriTypeConverter.cs
- PageAsyncTaskManager.cs
- PropertyInformation.cs
- InputEventArgs.cs
- X509SecurityTokenProvider.cs
- ControlAdapter.cs
- DataViewListener.cs
- x509store.cs
- LocalBuilder.cs
- Graph.cs
- NetTcpSecurity.cs
- XmlValidatingReader.cs
- AuthorizationRule.cs
- Int16Storage.cs
- CodeTypeMemberCollection.cs
- FilteredReadOnlyMetadataCollection.cs
- FixedSOMElement.cs
- RegexCharClass.cs
- FieldDescriptor.cs
- QilIterator.cs
- FilterQueryOptionExpression.cs
- PropertyTabAttribute.cs
- DelegatingHeader.cs
- Point3DCollection.cs
- ReflectEventDescriptor.cs
- DataBindingExpressionBuilder.cs
- UseAttributeSetsAction.cs
- HttpProfileGroupBase.cs
- BaseTemplateBuildProvider.cs
- TraceContextRecord.cs
- RawStylusActions.cs
- IdnElement.cs
- ObjectQueryProvider.cs
- RowUpdatedEventArgs.cs
- AuthorizationRuleCollection.cs
- Psha1DerivedKeyGenerator.cs
- StdRegProviderWrapper.cs
- Point3DCollectionValueSerializer.cs
- XmlSerializationGeneratedCode.cs
- AttachInfo.cs
- ButtonPopupAdapter.cs
- ResourceCategoryAttribute.cs
- ConnectionOrientedTransportManager.cs
- StringValidatorAttribute.cs
- LockCookie.cs
- Scene3D.cs
- DesignerEditorPartChrome.cs
- LocatorManager.cs
- EDesignUtil.cs
- FilterElement.cs
- ValidationErrorEventArgs.cs
- WebPartConnectionsCancelVerb.cs
- MailAddress.cs
- PointHitTestResult.cs
- Int32CAMarshaler.cs
- GridItemProviderWrapper.cs
- WebPartActionVerb.cs
- AutomationPropertyInfo.cs
- FindCriteria11.cs
- ImageSourceValueSerializer.cs
- XmlSchemaObjectTable.cs
- CatalogZoneAutoFormat.cs
- Storyboard.cs
- ColorMatrix.cs
- EntityDataSourceStatementEditorForm.cs
- CfgParser.cs
- BufferBuilder.cs
- ObjectFullSpanRewriter.cs
- EntityCommand.cs
- METAHEADER.cs
- GetPageNumberCompletedEventArgs.cs
- SQLMembershipProvider.cs
- AuthorizationRule.cs
- PointLightBase.cs
- StaticExtension.cs
- Content.cs
- ResourceManager.cs
- MenuCommand.cs
- Marshal.cs
- DataTableNewRowEvent.cs
- sqlnorm.cs
- TreeNodeMouseHoverEvent.cs