Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / SqlDataSourceCache.cs / 2 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ListBox.cs
- RenderDataDrawingContext.cs
- SapiRecoInterop.cs
- FontFamily.cs
- Button.cs
- HitTestParameters3D.cs
- ConstraintConverter.cs
- LongSumAggregationOperator.cs
- ColorTranslator.cs
- ellipse.cs
- ShellProvider.cs
- RadioButtonStandardAdapter.cs
- Dictionary.cs
- XamlTreeBuilder.cs
- SqlWriter.cs
- SectionXmlInfo.cs
- RenderTargetBitmap.cs
- SelectionProviderWrapper.cs
- CodeIdentifiers.cs
- CodeRemoveEventStatement.cs
- InputScopeManager.cs
- ButtonStandardAdapter.cs
- WebSysDisplayNameAttribute.cs
- CreationContext.cs
- ApplicationBuildProvider.cs
- MatrixKeyFrameCollection.cs
- HttpCapabilitiesBase.cs
- HttpProcessUtility.cs
- CharStorage.cs
- SubtreeProcessor.cs
- WindowsListViewItemCheckBox.cs
- SqlEnums.cs
- ExpressionBinding.cs
- EditingCoordinator.cs
- DataGridViewRowHeaderCell.cs
- AttachedAnnotation.cs
- TextContainerChangeEventArgs.cs
- MarginCollapsingState.cs
- KeyValuePairs.cs
- SvcMapFile.cs
- BrowsableAttribute.cs
- CollectionBuilder.cs
- ObjectQueryState.cs
- Frame.cs
- DataTableCollection.cs
- GACIdentityPermission.cs
- ColumnClickEvent.cs
- EventDescriptor.cs
- FtpWebRequest.cs
- ProcessHostConfigUtils.cs
- FrameworkElement.cs
- ListControlConvertEventArgs.cs
- SchemaObjectWriter.cs
- UndoEngine.cs
- IxmlLineInfo.cs
- PersonalizableTypeEntry.cs
- ToolStripScrollButton.cs
- DependencyObjectPropertyDescriptor.cs
- TreeNodeStyle.cs
- SessionConnectionReader.cs
- XmlNamespaceMappingCollection.cs
- GridViewHeaderRowPresenter.cs
- CommandLibraryHelper.cs
- BitmapEffectInputConnector.cs
- CharKeyFrameCollection.cs
- DefaultAssemblyResolver.cs
- DoubleMinMaxAggregationOperator.cs
- ListViewTableCell.cs
- InlineCollection.cs
- HtmlInputControl.cs
- CommentEmitter.cs
- ParseHttpDate.cs
- GridViewCancelEditEventArgs.cs
- FixedSchema.cs
- DetailsViewInsertEventArgs.cs
- SoapRpcServiceAttribute.cs
- DataSourceCacheDurationConverter.cs
- Activator.cs
- CmsInterop.cs
- FirstMatchCodeGroup.cs
- Math.cs
- IISUnsafeMethods.cs
- ExpressionBindingCollection.cs
- SystemResourceKey.cs
- Point3DCollectionConverter.cs
- DashStyle.cs
- PropertyDescriptorComparer.cs
- AccessControlList.cs
- XPathNodeInfoAtom.cs
- SessionPageStateSection.cs
- EntityContainer.cs
- Stack.cs
- RegexWorker.cs
- ProgressBarAutomationPeer.cs
- AspProxy.cs
- RefType.cs
- ToolStripLocationCancelEventArgs.cs
- XmlWrappingReader.cs
- BasicHttpSecurityElement.cs
- WindowCollection.cs