Export (0) Print
Expand All

DatabaseNotEnabledForNotificationException Class

The exception that is thrown when a SQL Server database is not enabled to support dependencies associated with the SqlCacheDependency class. This class cannot be inherited.

Namespace: System.Web.Caching
Assembly: System.Web (in system.web.dll)

[SerializableAttribute] 
public sealed class DatabaseNotEnabledForNotificationException : SystemException
/** @attribute SerializableAttribute() */ 
public final class DatabaseNotEnabledForNotificationException extends SystemException
SerializableAttribute 
public final class DatabaseNotEnabledForNotificationException extends SystemException
Not applicable.

The following code example is an exception handler for a simple administration page for setting up change notification in a SQL Server database.

For the full code required to run the example, see the Example section of the SqlCacheDependencyAdmin class overview topic.

catch (DatabaseNotEnabledForNotificationException ex)
{
  enabledTables.Visible = false;
  disableTable.Visible = false;
  enabledTablesMsg.Text = "Cache notifications are not enabled in this database.";

  tableName.Visible = false;
  enableTable.Visible = false;
  tableEnableMsg.Text = "Must enable database for notifications before enabling tables";
}

System.Object
   System.Exception
     System.SystemException
      System.Web.Caching.DatabaseNotEnabledForNotificationException

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft