Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- SoapEnumAttribute.cs
- HwndSubclass.cs
- XhtmlBasicListAdapter.cs
- BitmapEffectInput.cs
- TypedDataSourceCodeGenerator.cs
- XmlSchema.cs
- RangeBaseAutomationPeer.cs
- httpstaticobjectscollection.cs
- UnsafeNativeMethodsCLR.cs
- CloseCryptoHandleRequest.cs
- ConvertEvent.cs
- ScriptManagerProxy.cs
- InputReport.cs
- CqlGenerator.cs
- HttpConfigurationContext.cs
- TextLineBreak.cs
- DetailsViewInsertedEventArgs.cs
- PerfService.cs
- ShapeTypeface.cs
- BindValidationContext.cs
- KeyValuePairs.cs
- PEFileReader.cs
- RangeBase.cs
- EntityTransaction.cs
- FormViewPagerRow.cs
- safemediahandle.cs
- WebPartExportVerb.cs
- FontFamilyIdentifier.cs
- SafeReadContext.cs
- MarkupExtensionReturnTypeAttribute.cs
- ElementAction.cs
- StreamingContext.cs
- DefaultProfileManager.cs
- BrowserDefinitionCollection.cs
- AccessViolationException.cs
- EntryWrittenEventArgs.cs
- _RequestCacheProtocol.cs
- ParseChildrenAsPropertiesAttribute.cs
- DataKey.cs
- MD5CryptoServiceProvider.cs
- SvcFileManager.cs
- RegexCapture.cs
- AssemblySettingAttributes.cs
- XsdDataContractImporter.cs
- Splitter.cs
- DataSourceHelper.cs
- ParameterModifier.cs
- AnnotationResourceChangedEventArgs.cs
- UrlMappingCollection.cs
- BeginStoryboard.cs
- NotificationContext.cs
- SymmetricKey.cs
- RadioButtonList.cs
- QilParameter.cs
- UnsignedPublishLicense.cs
- MaterializeFromAtom.cs
- ColorBlend.cs
- Bits.cs
- DeviceContexts.cs
- WebPartConnectionsDisconnectVerb.cs
- InternalCache.cs
- XmlElementElement.cs
- SystemBrushes.cs
- AttachedPropertyInfo.cs
- SkinBuilder.cs
- safesecurityhelperavalon.cs
- KeyEvent.cs
- WorkItem.cs
- DataGridViewAccessibleObject.cs
- Timer.cs
- PropertyChange.cs
- UriTemplateLiteralPathSegment.cs
- ClaimSet.cs
- DbConnectionStringCommon.cs
- SectionVisual.cs
- COM2PictureConverter.cs
- DataTransferEventArgs.cs
- HttpCapabilitiesEvaluator.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- FlowLayout.cs
- NoneExcludedImageIndexConverter.cs
- DBConnectionString.cs
- TextBounds.cs
- AdornerPresentationContext.cs
- StatusBarPanel.cs
- FloaterBaseParaClient.cs
- DetailsViewUpdatedEventArgs.cs
- RenderDataDrawingContext.cs
- PropertyEmitterBase.cs
- PanelStyle.cs
- PixelFormatConverter.cs
- RenderOptions.cs
- WebMessageEncoderFactory.cs
- DbMetaDataColumnNames.cs
- CardSpaceException.cs
- GeneralEndpointIdentity.cs
- DeflateEmulationStream.cs
- InputLanguageCollection.cs
- GifBitmapEncoder.cs
- GraphicsState.cs