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
- RootBrowserWindow.cs
- AppDomain.cs
- ReachPrintTicketSerializer.cs
- LocalValueEnumerator.cs
- xsdvalidator.cs
- HttpListener.cs
- ToolStripDropDownItem.cs
- ObjectCloneHelper.cs
- DesignerObjectListAdapter.cs
- DataRecordInternal.cs
- SystemBrushes.cs
- ObjectSet.cs
- CreateInstanceBinder.cs
- TreeViewCancelEvent.cs
- PermissionSet.cs
- ValidationRule.cs
- OptimisticConcurrencyException.cs
- QualificationDataItem.cs
- ResourceManager.cs
- ToolboxItemSnapLineBehavior.cs
- CodeNamespaceImport.cs
- MetadataPropertyvalue.cs
- ColorConvertedBitmap.cs
- ClientConvert.cs
- LineBreak.cs
- WebEvents.cs
- SignatureHelper.cs
- VisualTarget.cs
- TraceSwitch.cs
- MetadataException.cs
- WebResponse.cs
- QuadraticBezierSegment.cs
- NullReferenceException.cs
- ViewStateModeByIdAttribute.cs
- BinaryCommonClasses.cs
- JapaneseCalendar.cs
- PersonalizationStateInfoCollection.cs
- TypeValidationEventArgs.cs
- CodeBinaryOperatorExpression.cs
- WebPartDisplayModeCollection.cs
- GradientSpreadMethodValidation.cs
- LoggedException.cs
- CustomDictionarySources.cs
- PageContentAsyncResult.cs
- VisualBrush.cs
- XmlSerializerFactory.cs
- ServiceAppDomainAssociationProvider.cs
- DataFormats.cs
- TCPClient.cs
- util.cs
- DataControlFieldCollection.cs
- Operand.cs
- InlineObject.cs
- TabControlCancelEvent.cs
- FlowDocumentPageViewerAutomationPeer.cs
- ToolTipService.cs
- WindowsListBox.cs
- SessionStateSection.cs
- StringSource.cs
- CachedPathData.cs
- EraserBehavior.cs
- SID.cs
- RenderDataDrawingContext.cs
- InputGestureCollection.cs
- RawStylusInputReport.cs
- MeasurementDCInfo.cs
- ByteStorage.cs
- AsymmetricKeyExchangeFormatter.cs
- CancellationScope.cs
- SafeRsaProviderHandle.cs
- NotSupportedException.cs
- wmiprovider.cs
- FrameworkElementAutomationPeer.cs
- MultipartContentParser.cs
- ParallelActivityDesigner.cs
- RotateTransform.cs
- DBConnection.cs
- TextBoxRenderer.cs
- DelegatingConfigHost.cs
- UInt16.cs
- XmlSchemaCollection.cs
- CacheAxisQuery.cs
- DataGridCell.cs
- MouseGestureValueSerializer.cs
- SecurityCapabilities.cs
- TerminatorSinks.cs
- MdImport.cs
- DbgUtil.cs
- AnnotationResource.cs
- MemberAccessException.cs
- XsdValidatingReader.cs
- ExpanderAutomationPeer.cs
- PenContexts.cs
- SplayTreeNode.cs
- _Events.cs
- TextElementCollection.cs
- ExpressionBindings.cs
- MailBnfHelper.cs
- ACE.cs
- TaiwanLunisolarCalendar.cs