Class SqlCacheDependency
Establishes a relationship between an item stored in an application's Cache object and either a row in a specific SQL Server database table or the results of a SQL Server 2005 query.
Inherited Members
Namespace:
Assembly: Alachisoft.NCache.Runtime.dll
Syntax
public sealed class SqlCacheDependency : CacheDependency
Remarks
You can add items with dependencies to your application's cache with the
When you add an item to an application's
This helps you avoid losing changes made to the object between the time it is created and the
time it is inserted into the
Constructors
SqlCacheDependency(String, String)
Initializes a new instance of the SqlCacheDependency class, using the supplied connection string and query string.
Declaration
public SqlCacheDependency(string connectionString, string cmdText)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | connection string to be used by dependency. |
System.String | cmdText | cmdText to be used by dependency. |
Remarks
This constructor is used to create SqlCacheDependency objects that use the query-notification feature of SQL Server 2005 products.
SQL query must include the following:
SqlCacheDependency(String, String, SqlCommandType, Dictionary<String, SqlCmdParams>)
Initializes a new instance of the SqlCacheDependency class. It supports the use of 'Stored Procedures'.
Declaration
public SqlCacheDependency(string connectionString, string cmdText, SqlCommandType cmdType, Dictionary<string, SqlCmdParams> cmdParams)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | connection string to be used by dependency. |
System.String | cmdText | cmdText to be used by dependency. |
SqlCommandType | cmdType | The type of the command. (text/stored procedure) |
Dictionary<System.String, SqlCmdParams> | cmdParams | Parameters to be passed to the command. |
Remarks
This constructor is used to create SqlCacheDependency objects that use the query-notification feature of SQL Server 2005 products.
SQL query must include the following:
Properties
CommandParams
Declaration
public Dictionary<string, SqlCmdParams> CommandParams { get; }
Property Value
Type | Description |
---|---|
Dictionary<System.String, SqlCmdParams> |
CommandText
Declaration
public string CommandText { get; }
Property Value
Type | Description |
---|---|
System.String |
CommandType
Declaration
public CommandType CommandType { get; }
Property Value
Type | Description |
---|---|
CommandType |
ConnectionString
Declaration
public string ConnectionString { get; }
Property Value
Type | Description |
---|---|
System.String |