Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / UI / SqlDataSourceCache.cs / 1 / SqlDataSourceCache.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System.Collections; using System.ComponentModel; using System.Web.Caching; internal sealed class SqlDataSourceCache : DataSourceCache { internal const string Sql9CacheDependencyDirective = "CommandNotification"; ////// A semi-colon delimited string indicating which databases to use for the dependency in the format "database1:table1;database2:table2". /// public string SqlCacheDependency { get { object o = ViewState["SqlCacheDependency"]; if (o != null) return (string)o; return String.Empty; } set { ViewState["SqlCacheDependency"] = value; } } #if !FEATURE_PAL // FEATURE_PAL does not fully enable SQL dependencies ////// Saves data to the ASP.NET cache using the specified key. /// protected override void SaveDataToCacheInternal(string key, object data, CacheDependency dependency) { string sqlCacheDependency = SqlCacheDependency; // Here we only create cache dependencies for SQL Server 2000 and // earlier that use a polling based mechanism. For SQL Server 2005 // and after, the data source itself creates the SqlCacheDependency // and passes it in as a parameter. if (sqlCacheDependency.Length > 0 && !String.Equals(sqlCacheDependency, Sql9CacheDependencyDirective, StringComparison.OrdinalIgnoreCase)) { // Call internal helper method to parse the dependency list CacheDependency sqlDependency = System.Web.Caching.SqlCacheDependency.CreateOutputCacheDependency(sqlCacheDependency); if (dependency != null) { // There was another dependency passed in, aggregate them AggregateCacheDependency aggregateDependency = new AggregateCacheDependency(); aggregateDependency.Add(sqlDependency, dependency); dependency = aggregateDependency; } else { // No other dependencies, just the SQL one dependency = sqlDependency; } } base.SaveDataToCacheInternal(key, data, dependency); } #endif // !FEATURE_PAL } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System.Collections; using System.ComponentModel; using System.Web.Caching; internal sealed class SqlDataSourceCache : DataSourceCache { internal const string Sql9CacheDependencyDirective = "CommandNotification"; ////// A semi-colon delimited string indicating which databases to use for the dependency in the format "database1:table1;database2:table2". /// public string SqlCacheDependency { get { object o = ViewState["SqlCacheDependency"]; if (o != null) return (string)o; return String.Empty; } set { ViewState["SqlCacheDependency"] = value; } } #if !FEATURE_PAL // FEATURE_PAL does not fully enable SQL dependencies ////// Saves data to the ASP.NET cache using the specified key. /// protected override void SaveDataToCacheInternal(string key, object data, CacheDependency dependency) { string sqlCacheDependency = SqlCacheDependency; // Here we only create cache dependencies for SQL Server 2000 and // earlier that use a polling based mechanism. For SQL Server 2005 // and after, the data source itself creates the SqlCacheDependency // and passes it in as a parameter. if (sqlCacheDependency.Length > 0 && !String.Equals(sqlCacheDependency, Sql9CacheDependencyDirective, StringComparison.OrdinalIgnoreCase)) { // Call internal helper method to parse the dependency list CacheDependency sqlDependency = System.Web.Caching.SqlCacheDependency.CreateOutputCacheDependency(sqlCacheDependency); if (dependency != null) { // There was another dependency passed in, aggregate them AggregateCacheDependency aggregateDependency = new AggregateCacheDependency(); aggregateDependency.Add(sqlDependency, dependency); dependency = aggregateDependency; } else { // No other dependencies, just the SQL one dependency = sqlDependency; } } base.SaveDataToCacheInternal(key, data, dependency); } #endif // !FEATURE_PAL } } // 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
- LinkLabelLinkClickedEvent.cs
- NamedObject.cs
- PathSegment.cs
- TreeNodeBindingCollection.cs
- DateTimeConverter2.cs
- DatatypeImplementation.cs
- PrintPageEvent.cs
- GenericXmlSecurityTokenAuthenticator.cs
- TableLayoutColumnStyleCollection.cs
- DataGridRowClipboardEventArgs.cs
- BrowserDefinitionCollection.cs
- NamespaceTable.cs
- ValueSerializer.cs
- FontInfo.cs
- ObjectManager.cs
- WindowsHyperlink.cs
- ToolStripPanelSelectionBehavior.cs
- UInt32Storage.cs
- ChannelServices.cs
- GeometryHitTestParameters.cs
- WebPartConnectionCollection.cs
- BitmapSizeOptions.cs
- ThicknessAnimationBase.cs
- FileDialog.cs
- AsymmetricAlgorithm.cs
- SafeTimerHandle.cs
- _OverlappedAsyncResult.cs
- DataPager.cs
- InputReport.cs
- WebPartManagerInternals.cs
- ClickablePoint.cs
- DrawingImage.cs
- ISO2022Encoding.cs
- UserControlAutomationPeer.cs
- FontCollection.cs
- ParallelTimeline.cs
- templategroup.cs
- EnvironmentPermission.cs
- CachedPathData.cs
- TemplateManager.cs
- CriticalHandle.cs
- DES.cs
- DbCommandDefinition.cs
- PrintPageEvent.cs
- MatrixTransform.cs
- VarRefManager.cs
- ISO2022Encoding.cs
- AccessKeyManager.cs
- RectangleHotSpot.cs
- SystemColorTracker.cs
- CompositeDuplexElement.cs
- GroupJoinQueryOperator.cs
- MainMenu.cs
- TripleDESCryptoServiceProvider.cs
- Rotation3DAnimation.cs
- InvalidAsynchronousStateException.cs
- IISMapPath.cs
- ThemeDirectoryCompiler.cs
- _SslState.cs
- SystemFonts.cs
- PipelineModuleStepContainer.cs
- Table.cs
- ImmComposition.cs
- Rfc2898DeriveBytes.cs
- XmlSchemaAnnotation.cs
- BooleanAnimationUsingKeyFrames.cs
- Attributes.cs
- DataMemberAttribute.cs
- DictionaryBase.cs
- CodeStatement.cs
- DynamicRenderer.cs
- RequestCachePolicyConverter.cs
- CatalogPartChrome.cs
- DecoderNLS.cs
- SmtpLoginAuthenticationModule.cs
- UnsafeNativeMethods.cs
- ContextBase.cs
- CheckBoxStandardAdapter.cs
- ModuleBuilderData.cs
- TextPattern.cs
- DataControlFieldCollection.cs
- RowsCopiedEventArgs.cs
- CustomTypeDescriptor.cs
- ZeroOpNode.cs
- AppLevelCompilationSectionCache.cs
- XamlGridLengthSerializer.cs
- RtfToXamlReader.cs
- VerificationAttribute.cs
- SettingsSavedEventArgs.cs
- FontUnitConverter.cs
- AssemblyCollection.cs
- HtmlElementErrorEventArgs.cs
- ManipulationInertiaStartingEventArgs.cs
- XmlArrayItemAttributes.cs
- SourceElementsCollection.cs
- WorkflowInstanceUnhandledExceptionRecord.cs
- TileBrush.cs
- PackageRelationship.cs
- ColumnPropertiesGroup.cs
- ToolStripPanelRow.cs