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
- StackSpiller.Bindings.cs
- MemoryMappedViewStream.cs
- TemplateEditingFrame.cs
- ReflectEventDescriptor.cs
- BitHelper.cs
- BoundColumn.cs
- WaitHandleCannotBeOpenedException.cs
- ExtensionElement.cs
- GradientSpreadMethodValidation.cs
- DoubleLink.cs
- ETagAttribute.cs
- LocalizableAttribute.cs
- DispatcherHooks.cs
- DataGridColumnHeaderCollection.cs
- ErrorHandler.cs
- AmbientValueAttribute.cs
- ExpandableObjectConverter.cs
- PointAnimation.cs
- CompilationSection.cs
- IdleTimeoutMonitor.cs
- ServiceOperation.cs
- ScriptMethodAttribute.cs
- WebServicesInteroperability.cs
- CqlLexerHelpers.cs
- DbConnectionHelper.cs
- SqlCharStream.cs
- NumericUpDownAcceleration.cs
- InternalEnumValidator.cs
- Mouse.cs
- cache.cs
- XmlException.cs
- StreamInfo.cs
- CompletionProxy.cs
- GridViewRowPresenterBase.cs
- ConstructorNeedsTagAttribute.cs
- Panel.cs
- StagingAreaInputItem.cs
- ConstraintCollection.cs
- DistinctQueryOperator.cs
- ChtmlCommandAdapter.cs
- WebBrowserHelper.cs
- CodeSnippetStatement.cs
- LoadedOrUnloadedOperation.cs
- LocationReferenceEnvironment.cs
- StackBuilderSink.cs
- ItemsPresenter.cs
- OrthographicCamera.cs
- PointCollectionValueSerializer.cs
- BasicHttpMessageCredentialType.cs
- XsltFunctions.cs
- LicenseException.cs
- EntityViewGenerator.cs
- XmlQueryTypeFactory.cs
- EntityContainerRelationshipSetEnd.cs
- PolyLineSegment.cs
- Double.cs
- cache.cs
- Point3DCollection.cs
- ParagraphVisual.cs
- XmlNamespaceMappingCollection.cs
- _LocalDataStore.cs
- EncoderReplacementFallback.cs
- ConnectionPointCookie.cs
- TypeProvider.cs
- XamlClipboardData.cs
- DependencyStoreSurrogate.cs
- WindowsSecurityToken.cs
- FileLogRecordEnumerator.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- TemplateBindingExpression.cs
- ActivityExecutorSurrogate.cs
- StylusPointPropertyInfo.cs
- DisposableCollectionWrapper.cs
- MetadataItem.cs
- DataGridViewCellValidatingEventArgs.cs
- TCPListener.cs
- UnsafeNetInfoNativeMethods.cs
- TextParagraphProperties.cs
- FixedBufferAttribute.cs
- URLIdentityPermission.cs
- WorkflowWebService.cs
- MultipleViewProviderWrapper.cs
- MultipartContentParser.cs
- ContextMenu.cs
- MenuItemStyle.cs
- NestedContainer.cs
- ToolStripRendererSwitcher.cs
- RepeaterItem.cs
- UInt64.cs
- BinaryConverter.cs
- SystemInformation.cs
- Update.cs
- SamlAuthorizationDecisionStatement.cs
- DataRowCollection.cs
- Errors.cs
- PopupRootAutomationPeer.cs
- CompilationPass2TaskInternal.cs
- MultiPageTextView.cs
- HtmlElementCollection.cs
- SqlLiftWhereClauses.cs