Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / Odbc / OdbcConnectionString.cs / 1305376 / OdbcConnectionString.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.Odbc { using System; using System.Collections; using System.Data; using System.Data.Common; using System.Security; using System.Security.Permissions; using System.Text; internal sealed class OdbcConnectionString : DbConnectionOptions { // instances of this class are intended to be immutable, i.e readonly // used by pooling classes so it is much easier to verify correctness // when not worried about the class being modified during execution private static class KEY { internal const string SaveFile = "savefile"; } private readonly string _expandedConnectionString; internal OdbcConnectionString(string connectionString, bool validate) : base(connectionString, null, true) { if (!validate) { string filename = null; int position = 0; _expandedConnectionString = ExpandDataDirectories(ref filename, ref position); } if (validate || (null == _expandedConnectionString)) { // do not check string length if it was expanded because the final result may be shorter than the original if ((null != connectionString) && (ODBC32.MAX_CONNECTION_STRING_LENGTH < connectionString.Length)) { // MDAC 83536 throw ODBC.ConnectionStringTooLong(); } } } protected internal override System.Security.PermissionSet CreatePermissionSet() { System.Security.PermissionSet permissionSet; if (ContainsKey(KEY.SaveFile)) { permissionSet = new NamedPermissionSet("FullTrust"); } else { permissionSet = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.None); permissionSet.AddPermission(new OdbcPermission(this)); } return permissionSet; } protected internal override string Expand() { if (null != _expandedConnectionString) { return _expandedConnectionString; } else { return base.Expand(); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.Odbc { using System; using System.Collections; using System.Data; using System.Data.Common; using System.Security; using System.Security.Permissions; using System.Text; internal sealed class OdbcConnectionString : DbConnectionOptions { // instances of this class are intended to be immutable, i.e readonly // used by pooling classes so it is much easier to verify correctness // when not worried about the class being modified during execution private static class KEY { internal const string SaveFile = "savefile"; } private readonly string _expandedConnectionString; internal OdbcConnectionString(string connectionString, bool validate) : base(connectionString, null, true) { if (!validate) { string filename = null; int position = 0; _expandedConnectionString = ExpandDataDirectories(ref filename, ref position); } if (validate || (null == _expandedConnectionString)) { // do not check string length if it was expanded because the final result may be shorter than the original if ((null != connectionString) && (ODBC32.MAX_CONNECTION_STRING_LENGTH < connectionString.Length)) { // MDAC 83536 throw ODBC.ConnectionStringTooLong(); } } } protected internal override System.Security.PermissionSet CreatePermissionSet() { System.Security.PermissionSet permissionSet; if (ContainsKey(KEY.SaveFile)) { permissionSet = new NamedPermissionSet("FullTrust"); } else { permissionSet = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.None); permissionSet.AddPermission(new OdbcPermission(this)); } return permissionSet; } protected internal override string Expand() { if (null != _expandedConnectionString) { return _expandedConnectionString; } else { return base.Expand(); } } } } // 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
- DocumentPaginator.cs
- TabOrder.cs
- SchemaInfo.cs
- IntegerFacetDescriptionElement.cs
- CatalogPartDesigner.cs
- ThemeDictionaryExtension.cs
- ListViewContainer.cs
- SpStreamWrapper.cs
- QueryOptionExpression.cs
- DispatcherSynchronizationContext.cs
- VirtualPathUtility.cs
- RealProxy.cs
- LiteralControl.cs
- AddDataControlFieldDialog.cs
- UserMapPath.cs
- Accessible.cs
- Drawing.cs
- SQLStringStorage.cs
- XmlUtil.cs
- SessionStateModule.cs
- Types.cs
- MediaPlayer.cs
- TTSEvent.cs
- CompilerTypeWithParams.cs
- Trigger.cs
- Graphics.cs
- DataServiceConfiguration.cs
- UrlMappingsModule.cs
- cryptoapiTransform.cs
- ConstructorNeedsTagAttribute.cs
- IncrementalReadDecoders.cs
- SpeakInfo.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- DocumentPageTextView.cs
- ApplyImportsAction.cs
- AvTraceFormat.cs
- UnsafeMethods.cs
- GacUtil.cs
- TemporaryBitmapFile.cs
- ImageFormatConverter.cs
- IgnoreDeviceFilterElementCollection.cs
- SamlAdvice.cs
- HelpInfo.cs
- NavigatorInput.cs
- FirstMatchCodeGroup.cs
- ControllableStoryboardAction.cs
- CompositeTypefaceMetrics.cs
- GenericTypeParameterBuilder.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- WebPartConnectionsConnectVerb.cs
- RelationshipType.cs
- LinqDataSourceSelectEventArgs.cs
- MulticastNotSupportedException.cs
- PageBuildProvider.cs
- DataGridColumnStyleMappingNameEditor.cs
- WindowsRichEditRange.cs
- CompareValidator.cs
- ParameterCollection.cs
- MSG.cs
- MsmqIntegrationBindingElement.cs
- SqlCacheDependency.cs
- TemplateParser.cs
- AncillaryOps.cs
- Vector3DCollectionConverter.cs
- CultureInfoConverter.cs
- HttpCookie.cs
- PeerResolverBindingElement.cs
- SpeechUI.cs
- EntityObject.cs
- CollectionConverter.cs
- SamlAdvice.cs
- TypeSystem.cs
- Stopwatch.cs
- xdrvalidator.cs
- UIServiceHelper.cs
- _AutoWebProxyScriptEngine.cs
- GlobalizationSection.cs
- SaveFileDialog.cs
- ElementProxy.cs
- PageContent.cs
- ModifyActivitiesPropertyDescriptor.cs
- UnconditionalPolicy.cs
- cookieexception.cs
- BodyGlyph.cs
- Validator.cs
- TrackingQuery.cs
- ChannelSinkStacks.cs
- MultiSelectRootGridEntry.cs
- InvalidAsynchronousStateException.cs
- SourceLocation.cs
- PersonalizationProviderHelper.cs
- ZipArchive.cs
- FlowLayout.cs
- EntityUtil.cs
- AdPostCacheSubstitution.cs
- BaseHashHelper.cs
- SqlDependencyListener.cs
- AnimatedTypeHelpers.cs
- DrawListViewColumnHeaderEventArgs.cs
- ProcessInfo.cs