Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- TrackingProfileSerializer.cs
- EnumUnknown.cs
- SqlConnectionStringBuilder.cs
- EditorPartChrome.cs
- OracleCommandSet.cs
- ServiceNameCollection.cs
- ToolBarPanel.cs
- SqlCacheDependency.cs
- WebServicesSection.cs
- Transform.cs
- XmlSchemaSet.cs
- CustomAttributeSerializer.cs
- Base64Stream.cs
- CaseStatementProjectedSlot.cs
- PreservationFileReader.cs
- LongValidatorAttribute.cs
- StringInfo.cs
- SqlFileStream.cs
- DataServicePagingProviderWrapper.cs
- XmlILOptimizerVisitor.cs
- ConfigurationManagerHelper.cs
- AgileSafeNativeMemoryHandle.cs
- UniqueConstraint.cs
- FormView.cs
- DynamicMethod.cs
- DataKeyArray.cs
- RadioButtonAutomationPeer.cs
- ImageIndexConverter.cs
- EditorPart.cs
- HostedImpersonationContext.cs
- DropShadowBitmapEffect.cs
- BaseCodeDomTreeGenerator.cs
- QuotaThrottle.cs
- DocumentsTrace.cs
- ServiceBehaviorElementCollection.cs
- DataSourceIDConverter.cs
- FtpCachePolicyElement.cs
- UIElementIsland.cs
- EasingKeyFrames.cs
- DataGridViewCellStateChangedEventArgs.cs
- DataGridViewColumn.cs
- FlowSwitchLink.cs
- EdmFunction.cs
- FileDataSourceCache.cs
- XmlMembersMapping.cs
- TitleStyle.cs
- XmlDocument.cs
- InlineUIContainer.cs
- ManagedIStream.cs
- SendAgentStatusRequest.cs
- SessionEndingCancelEventArgs.cs
- XmlNamespaceMappingCollection.cs
- ConfigXmlWhitespace.cs
- DSGeneratorProblem.cs
- RepeaterCommandEventArgs.cs
- RuntimeUtils.cs
- RecordManager.cs
- mongolianshape.cs
- TypeNameConverter.cs
- Property.cs
- RemoveStoryboard.cs
- GorillaCodec.cs
- NotifyInputEventArgs.cs
- AttributeCollection.cs
- AssemblyHelper.cs
- DataGridPagerStyle.cs
- ScriptControlDescriptor.cs
- LogicalExpr.cs
- Int64Converter.cs
- HostedElements.cs
- BamlResourceSerializer.cs
- HitTestResult.cs
- Normalizer.cs
- ColumnReorderedEventArgs.cs
- ChannelDemuxer.cs
- SmiRecordBuffer.cs
- Oid.cs
- BindingSource.cs
- SelectorItemAutomationPeer.cs
- CultureTableRecord.cs
- NamedPermissionSet.cs
- ProgressBarAutomationPeer.cs
- CommonDialog.cs
- UrlAuthorizationModule.cs
- HandleRef.cs
- Parser.cs
- Vector3DConverter.cs
- MasterPageCodeDomTreeGenerator.cs
- UserControlCodeDomTreeGenerator.cs
- InputLanguageManager.cs
- RequestFactory.cs
- TransactionTraceIdentifier.cs
- SqlConnectionString.cs
- SynchronousChannel.cs
- MultiTrigger.cs
- SemanticAnalyzer.cs
- ArraySortHelper.cs
- ToolStripRendererSwitcher.cs
- MarkupCompilePass1.cs
- ClientFormsAuthenticationCredentials.cs