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
- HtmlForm.cs
- WebPartTracker.cs
- OperationPickerDialog.designer.cs
- SqlUserDefinedTypeAttribute.cs
- manifestimages.cs
- SoapSchemaMember.cs
- GroupBoxDesigner.cs
- BrowserDefinitionCollection.cs
- NumericUpDownAccelerationCollection.cs
- CompilerGlobalScopeAttribute.cs
- GridViewSelectEventArgs.cs
- CfgParser.cs
- XmlToDatasetMap.cs
- DataGridViewColumnConverter.cs
- BevelBitmapEffect.cs
- formatter.cs
- XmlRootAttribute.cs
- Int32RectValueSerializer.cs
- TransformerInfo.cs
- JulianCalendar.cs
- ListViewHitTestInfo.cs
- _HelperAsyncResults.cs
- _ProxyChain.cs
- DesignerTextViewAdapter.cs
- TraceData.cs
- DateTimePicker.cs
- BindingNavigator.cs
- ListenerHandler.cs
- FixUp.cs
- BaseServiceProvider.cs
- TextEffectCollection.cs
- ClassValidator.cs
- TrackingStringDictionary.cs
- StaticTextPointer.cs
- TextEndOfLine.cs
- ToolStripPanelSelectionGlyph.cs
- ActivatedMessageQueue.cs
- CreateUserErrorEventArgs.cs
- Panel.cs
- DataPagerFieldItem.cs
- CompilerCollection.cs
- CombinedGeometry.cs
- DrawingGroup.cs
- XmlSecureResolver.cs
- CreateUserWizardStep.cs
- WhiteSpaceTrimStringConverter.cs
- JoinSymbol.cs
- Int32CollectionValueSerializer.cs
- BaseTemplateBuildProvider.cs
- EntitySqlQueryCacheEntry.cs
- UIElement3D.cs
- ServicePointManagerElement.cs
- Int32CollectionConverter.cs
- ComponentCommands.cs
- bidPrivateBase.cs
- ResourceIDHelper.cs
- ComplexTypeEmitter.cs
- CellParaClient.cs
- TextTreeDeleteContentUndoUnit.cs
- UniqueEventHelper.cs
- TransactionInterop.cs
- DecoderFallback.cs
- TransformPattern.cs
- TypeLibConverter.cs
- ExpanderAutomationPeer.cs
- DataGridViewRowEventArgs.cs
- XmlSchemaCollection.cs
- sqlmetadatafactory.cs
- HashRepartitionStream.cs
- RegexCompiler.cs
- HMACSHA384.cs
- SiteOfOriginContainer.cs
- ContainsRowNumberChecker.cs
- BinHexDecoder.cs
- TabPageDesigner.cs
- DeferredSelectedIndexReference.cs
- XmlSchemaSimpleContentExtension.cs
- AssociationSet.cs
- _KerberosClient.cs
- GridViewDeleteEventArgs.cs
- FtpWebResponse.cs
- CodeTypeParameterCollection.cs
- SafeEventLogWriteHandle.cs
- DataContractAttribute.cs
- MergeLocalizationDirectives.cs
- Button.cs
- HtmlTernaryTree.cs
- SvcMapFileSerializer.cs
- FolderBrowserDialogDesigner.cs
- StringArrayConverter.cs
- GeneralTransformGroup.cs
- storepermission.cs
- InternalSafeNativeMethods.cs
- MatrixTransform3D.cs
- DataRecordInternal.cs
- TableHeaderCell.cs
- _NegoStream.cs
- ColumnHeaderCollectionEditor.cs
- FormatControl.cs
- Underline.cs