Class MsSqlServerStorage
IStorage implementation utilizing the MS SQL server database engine.
Inheritance
Namespace: Telerik.Reporting.Cache
Assembly: Telerik.Reporting.dll
Syntax
public class MsSqlServerStorage : IStorage2, IStorage, ISupportMatchingOperators, ISupportSchemaCreation
Remarks
MsSqlServerStorage connects to SQL server using the .NET Framework Data Provider for SQL Server (System.Data.SqlClient Namespace).
The storage needs a host database with specific tables and stored procedures which may be created in dedicated or shared database. The necessary SQL objects may be created using the DatabaseCacheConfigurator tool (located under the Telerik Reporting installation folder / Tools) or manually executing the follow DDL script. It adds all needed objects to an existing MS SQL database (execute in the context of existing database).
Constructors
MsSqlServerStorage(String)
Initializes a new instance of the MsSqlServerStorage class.
Declaration
public MsSqlServerStorage(string connectionString)
Parameters
System.String
connectionString
The connection string to the backend storage. Connection Strings in ADO.NET |
MsSqlServerStorage(String, Int32)
Initializes a new instance of the MsSqlServerStorage class.
Declaration
public MsSqlServerStorage(string connectionString, int commandTimeout)
Parameters
System.String
connectionString
The connection string to the backend storage. Connection Strings in ADO.NET |
System.Int32
commandTimeout
Determines the CommandTimeout that will be used when executing database commands, in seconds. The default value is 30. SqlCommand.CommandTimeout |
Methods
AcquireLock(String)
Acquires a lock on a named resource.
Declaration
public IDisposable AcquireLock(string key)
Parameters
System.String
key
|
Returns
System.IDisposable
|
Implements
See Also
AcquireReadLock(String)
Acquires a lock on a named resource for reading. Uses Transaction with lower isolation level.
Declaration
public IDisposable AcquireReadLock(string key)
Parameters
System.String
key
|
Returns
System.IDisposable
|
Implements
See Also
AddInSet(String, String)
Adds a single string value to a set of values denoted from the given key.
Declaration
public void AddInSet(string key, string value)
Parameters
System.String
key
|
System.String
value
|
Implements
See Also
ClearAllData()
Utility method. Clears all data from the storage data tables.
Declaration
public void ClearAllData()
CreateObjects(String)
Declaration
public void CreateObjects(string ddl)
Parameters
System.String
ddl
|
CreateSchema(Boolean, Boolean)
Utility method. Creates the data schema (tables and stored procedures) needed from the storage.
Declaration
public void CreateSchema(bool createTables = true, bool createProcedures = true)
Parameters
System.Boolean
createTables
|
System.Boolean
createProcedures
|
Delete(String)
Deletes a key with its value (string or byte array) from the storage.
Declaration
public void Delete(string key)
Parameters
System.String
key
|
Implements
See Also
DeleteInSet(String, String)
Deletes a single string value from a set of values denoted from the given key.
Declaration
public bool DeleteInSet(string key, string value)
Parameters
System.String
key
|
System.String
value
|
Returns
System.Boolean
|
Implements
See Also
DeleteMasterKey(String)
Declaration
public void DeleteMasterKey(string key)
Parameters
System.String
key
|
Implements
DeleteSet(String)
Deletes a set of values denoted by the given key.
Declaration
public void DeleteSet(string key)
Parameters
System.String
key
|
Implements
See Also
Exists(String)
Retrieves a value indicating if a single value (string or byte array) exists in the storage.
Declaration
public bool Exists(string key)
Parameters
System.String
key
|
Returns
System.Boolean
|
Implements
See Also
ExistsInSet(String, String)
Retrieves a value indicating if a set of values exists in the storage.
Declaration
public bool ExistsInSet(string key, string value)
Parameters
System.String
key
|
System.String
value
|
Returns
System.Boolean
|
Implements
See Also
GetAllMembersInSet(String)
Retrieves all members in a set of string values.
Declaration
public IEnumerable<string> GetAllMembersInSet(string key)
Parameters
System.String
key
|
Returns
System.Collections.Generic.IEnumerable<System.String>
|
Implements
See Also
GetBytes(String)
Retrieves a byte array value stored under particular key.
Declaration
public byte[] GetBytes(string key)
Parameters
System.String
key
|
Returns
System.Byte[]
|
Implements
See Also
GetCountInSet(String)
Retrieves the count of the values in a set value stored in the storage.
Declaration
public long GetCountInSet(string key)
Parameters
System.String
key
|
Returns
System.Int64
|
Implements
See Also
GetInstancesByKey(String, Byte[])
Declaration
public IEnumerable<string> GetInstancesByKey(string keyPropertyId, byte[] keyValue)
Parameters
System.String
keyPropertyId
|
System.Byte[]
keyValue
|
Returns
System.Collections.Generic.IEnumerable<System.String>
|
GetString(String)
Retrieves a string value stored under particular key.
Declaration
public string GetString(string key)
Parameters
System.String
key
|
Returns
System.String
|
Implements
See Also
SetBytes(String, Byte[])
Stores a byte array value under particular key.
Declaration
public void SetBytes(string key, byte[] value)
Parameters
System.String
key
|
System.Byte[]
value
|
Implements
See Also
SetString(String, String)
Stores a string value under particular key.
Declaration
public void SetString(string key, string value)
Parameters
System.String
key
|
System.String
value
|