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
- COAUTHINFO.cs
- ButtonChrome.cs
- ZipIOBlockManager.cs
- FileIOPermission.cs
- BreakRecordTable.cs
- NetworkStream.cs
- DelegatingHeader.cs
- WebPartConnectionsCancelVerb.cs
- CodeTypeDeclaration.cs
- FontUnit.cs
- KeyConstraint.cs
- SessionPageStatePersister.cs
- GridItemProviderWrapper.cs
- OperationCanceledException.cs
- FlowNode.cs
- WriteFileContext.cs
- HandlerBase.cs
- ResourceSet.cs
- UnknownBitmapDecoder.cs
- ProviderConnectionPointCollection.cs
- ThreadStateException.cs
- DispatcherHooks.cs
- DependencyPropertyKind.cs
- RegistryConfigurationProvider.cs
- RootBrowserWindowProxy.cs
- ReceiveContent.cs
- validationstate.cs
- DeadCharTextComposition.cs
- IncomingWebRequestContext.cs
- FormsAuthenticationTicket.cs
- ContextStack.cs
- ReadWriteObjectLock.cs
- XmlUnspecifiedAttribute.cs
- VirtualizingStackPanel.cs
- BindingNavigator.cs
- Encoder.cs
- XPathNodeInfoAtom.cs
- SchemaNotation.cs
- Point3DCollectionValueSerializer.cs
- InputBuffer.cs
- SiteMapNodeItemEventArgs.cs
- ToolStripProgressBar.cs
- XsltSettings.cs
- SimpleFileLog.cs
- CodeDomLoader.cs
- ServiceOperationParameter.cs
- BasicHttpBinding.cs
- TreeNodeClickEventArgs.cs
- FixedSOMSemanticBox.cs
- CommonRemoteMemoryBlock.cs
- log.cs
- ImageList.cs
- ProxyGenerator.cs
- DocumentPageTextView.cs
- MenuItemStyleCollection.cs
- EtwTrackingBehavior.cs
- Stylesheet.cs
- IISMapPath.cs
- RC2.cs
- SecUtil.cs
- HybridWebProxyFinder.cs
- Comparer.cs
- WhitespaceRuleLookup.cs
- NodeInfo.cs
- ObjectManager.cs
- WebSysDisplayNameAttribute.cs
- BeginEvent.cs
- NoClickablePointException.cs
- Activity.cs
- DataGridViewUtilities.cs
- FunctionOverloadResolver.cs
- DragEventArgs.cs
- FileChangesMonitor.cs
- CodeGroup.cs
- DateTimeUtil.cs
- HttpAsyncResult.cs
- unitconverter.cs
- RequestCachePolicy.cs
- ForceCopyBuildProvider.cs
- Oid.cs
- EventListener.cs
- GenericXmlSecurityToken.cs
- PropertyGeneratedEventArgs.cs
- FormViewCommandEventArgs.cs
- SoapCodeExporter.cs
- ObjectDataSourceStatusEventArgs.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- ScrollViewerAutomationPeer.cs
- IResourceProvider.cs
- SqlFileStream.cs
- ErrorFormatterPage.cs
- Hyperlink.cs
- CodeCatchClauseCollection.cs
- HyperLinkField.cs
- ConfigurationStrings.cs
- EntityWithKeyStrategy.cs
- DiscoveryReferences.cs
- WebMethodAttribute.cs
- SizeAnimationBase.cs
- DateTimeOffsetStorage.cs