Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TagNameToTypeMapper.cs
- RuntimeHandles.cs
- TextContainerChangedEventArgs.cs
- WindowPattern.cs
- FocusWithinProperty.cs
- DataGridViewCellConverter.cs
- WindowsScrollBarBits.cs
- ReflectionTypeLoadException.cs
- ExceptionUtil.cs
- OleDbSchemaGuid.cs
- UnsafeNativeMethods.cs
- ConfigXmlComment.cs
- ClientOptions.cs
- PathGradientBrush.cs
- ResolvedKeyFrameEntry.cs
- ValuePatternIdentifiers.cs
- LoginCancelEventArgs.cs
- counter.cs
- EnumerableWrapperWeakToStrong.cs
- FormViewDeletedEventArgs.cs
- AspNetSynchronizationContext.cs
- SwitchElementsCollection.cs
- EntityDataSourceValidationException.cs
- _ShellExpression.cs
- CaseExpr.cs
- SqlRowUpdatingEvent.cs
- ScriptResourceDefinition.cs
- XmlEncoding.cs
- CalendarDayButton.cs
- MatrixValueSerializer.cs
- ZipIOCentralDirectoryFileHeader.cs
- SiteMapDataSource.cs
- ThemeableAttribute.cs
- ChooseAction.cs
- ScriptManager.cs
- JsonFormatWriterGenerator.cs
- WebProxyScriptElement.cs
- Boolean.cs
- SqlInternalConnectionSmi.cs
- PerformanceCounterCategory.cs
- DataTable.cs
- SizeChangedInfo.cs
- EFTableProvider.cs
- DataControlFieldCollection.cs
- NamespaceCollection.cs
- Encoder.cs
- RelatedCurrencyManager.cs
- ListViewItemEventArgs.cs
- TimeoutException.cs
- SliderAutomationPeer.cs
- DateRangeEvent.cs
- PerspectiveCamera.cs
- HotSpot.cs
- FillRuleValidation.cs
- StringAttributeCollection.cs
- GotoExpression.cs
- IncrementalReadDecoders.cs
- StreamReader.cs
- CalloutQueueItem.cs
- MemoryMappedViewStream.cs
- PropertyFilterAttribute.cs
- CalendarModeChangedEventArgs.cs
- RectAnimationBase.cs
- Atom10FormatterFactory.cs
- WebBrowserContainer.cs
- ValidatedControlConverter.cs
- ByteStream.cs
- Button.cs
- DataGridViewAutoSizeModeEventArgs.cs
- ByteConverter.cs
- DataGridViewButtonColumn.cs
- FrameSecurityDescriptor.cs
- Visitors.cs
- ExceptionValidationRule.cs
- SqlIdentifier.cs
- QueryExpr.cs
- SrgsGrammar.cs
- ImageAutomationPeer.cs
- SrgsRule.cs
- SchemaNamespaceManager.cs
- CompiledRegexRunner.cs
- ToolboxComponentsCreatingEventArgs.cs
- TableAutomationPeer.cs
- DeploymentSectionCache.cs
- InternalSafeNativeMethods.cs
- OutputScopeManager.cs
- ModelTreeManager.cs
- ConfigXmlWhitespace.cs
- X509ServiceCertificateAuthentication.cs
- PreProcessor.cs
- SiteMapDataSourceView.cs
- InvalidPrinterException.cs
- GraphicsContext.cs
- TypeConstant.cs
- DataGridViewCellLinkedList.cs
- TitleStyle.cs
- EditorPart.cs
- PrimarySelectionAdorner.cs
- SuppressMessageAttribute.cs
- httpstaticobjectscollection.cs