Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- ParentQuery.cs
- ListMarkerSourceInfo.cs
- MasterPageParser.cs
- Base64Decoder.cs
- SchemaMerger.cs
- EpmContentDeSerializer.cs
- SettingsPropertyNotFoundException.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- DmlSqlGenerator.cs
- GlobalEventManager.cs
- AccessDataSourceDesigner.cs
- ApplicationServicesHostFactory.cs
- GeometryDrawing.cs
- RenderData.cs
- SecurityTokenException.cs
- Clock.cs
- QueryStringParameter.cs
- ListView.cs
- MailAddress.cs
- ByteStreamMessage.cs
- SiteMapDataSourceView.cs
- TemplateContent.cs
- SkipQueryOptionExpression.cs
- WinFormsComponentEditor.cs
- XmlObjectSerializerReadContext.cs
- DataExchangeServiceBinder.cs
- EntityTypeBase.cs
- Icon.cs
- UriWriter.cs
- WeakReferenceList.cs
- SiteMapNodeItemEventArgs.cs
- TypeUtils.cs
- Action.cs
- ConfigurationProperty.cs
- DataGridViewColumnStateChangedEventArgs.cs
- TextOptions.cs
- SoapRpcServiceAttribute.cs
- TreeViewImageKeyConverter.cs
- PublishLicense.cs
- CellTreeNode.cs
- SevenBitStream.cs
- ExpressionWriter.cs
- LinqDataSourceSelectEventArgs.cs
- UnsupportedPolicyOptionsException.cs
- Trace.cs
- MdImport.cs
- NetworkStream.cs
- MachineKeySection.cs
- AttributeUsageAttribute.cs
- QuaternionRotation3D.cs
- EntityDataSourceDesigner.cs
- PointF.cs
- MessageDecoder.cs
- LinqDataSourceContextEventArgs.cs
- InputMethodStateTypeInfo.cs
- DelegateSerializationHolder.cs
- Menu.cs
- ReadOnlyCollectionBase.cs
- ElementHost.cs
- ExtentKey.cs
- StandardToolWindows.cs
- FormView.cs
- XmlUtf8RawTextWriter.cs
- CodeSubDirectoriesCollection.cs
- ColorConvertedBitmapExtension.cs
- ImageButton.cs
- SQLChars.cs
- DockPattern.cs
- SelectionListDesigner.cs
- RenderData.cs
- TextParagraphCache.cs
- DescendentsWalker.cs
- ServerIdentity.cs
- sqlnorm.cs
- EpmSyndicationContentSerializer.cs
- SafeCancelMibChangeNotify.cs
- ItemsPanelTemplate.cs
- ViewEvent.cs
- BamlRecords.cs
- Vector3DCollectionConverter.cs
- WebPartEditVerb.cs
- NamedServiceModelExtensionCollectionElement.cs
- ImpersonationContext.cs
- ProfileEventArgs.cs
- FormView.cs
- XmlSchemaException.cs
- ChtmlCalendarAdapter.cs
- EntitySetDataBindingList.cs
- XmlSecureResolver.cs
- Globals.cs
- OutputCacheModule.cs
- WindowPatternIdentifiers.cs
- PersonalizationProviderHelper.cs
- ArrangedElement.cs
- ScaleTransform.cs
- CodeAccessSecurityEngine.cs
- backend.cs
- RequiredAttributeAttribute.cs
- TextRangeSerialization.cs
- Oid.cs