Try our conversational search powered by Generative AI!

Class DataAccessBase

Base class for database access classes. Provides database abstraction and utility methods. This class supports the EPiServer infrastructure and is not intended to be used directly from your code.

Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.DataAccess
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public abstract class DataAccessBase
Remarks

Note that the actual database abstraction is done by the DatabaseFactory class hierarchy based on the class factory pattern.

Constructors

DataAccessBase(IDatabaseHandler)

Initializes a new instance of the DataAccessBase class. This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
protected DataAccessBase(IDatabaseHandler databaseHandler)
Parameters
Type Name Description
IDatabaseHandler databaseHandler

The IDatabaseHandler that will be used for database communication.

Properties

Database

Set database handler used for this instance This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
public IDatabaseHandler Database { get; set; }
Property Value
Type Description
IDatabaseHandler

Methods

CreateCommand()

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
protected DbCommand CreateCommand()
Returns
Type Description
System.Data.Common.DbCommand

CreateCommand(String)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
protected DbCommand CreateCommand(string cmdText)
Parameters
Type Name Description
System.String cmdText
Returns
Type Description
System.Data.Common.DbCommand

CreateDataAdapter()

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
public DbDataAdapter CreateDataAdapter()
Returns
Type Description
System.Data.Common.DbDataAdapter

CreateDataAdapter(DbCommand)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
public DbDataAdapter CreateDataAdapter(DbCommand cmd)
Parameters
Type Name Description
System.Data.Common.DbCommand cmd
Returns
Type Description
System.Data.Common.DbDataAdapter

CreateDataAdapter(DbCommand, DbCommand, DbCommand)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
public DbDataAdapter CreateDataAdapter(DbCommand cmdInsert, DbCommand cmdUpdate, DbCommand cmdDelete)
Parameters
Type Name Description
System.Data.Common.DbCommand cmdInsert
System.Data.Common.DbCommand cmdUpdate
System.Data.Common.DbCommand cmdDelete
Returns
Type Description
System.Data.Common.DbDataAdapter

CreateDataAdapter(DbCommand, DbCommand, DbCommand, DbCommand)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
public DbDataAdapter CreateDataAdapter(DbCommand cmdSelect, DbCommand cmdInsert, DbCommand cmdUpdate, DbCommand cmdDelete)
Parameters
Type Name Description
System.Data.Common.DbCommand cmdSelect
System.Data.Common.DbCommand cmdInsert
System.Data.Common.DbCommand cmdUpdate
System.Data.Common.DbCommand cmdDelete
Returns
Type Description
System.Data.Common.DbDataAdapter

CreateParameter(String, DbType, ParameterDirection, Object)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
protected DbParameter CreateParameter(string parameterName, DbType dbType, ParameterDirection paramDir, object paramValue)
Parameters
Type Name Description
System.String parameterName
System.Data.DbType dbType
System.Data.ParameterDirection paramDir
System.Object paramValue
Returns
Type Description
System.Data.Common.DbParameter

CreateParameter(String, DbType, Int32)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
protected DbParameter CreateParameter(string parameterName, DbType dbType, int size)
Parameters
Type Name Description
System.String parameterName
System.Data.DbType dbType
System.Int32 size
Returns
Type Description
System.Data.Common.DbParameter

CreateParameter(String, Object)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
protected DbParameter CreateParameter(string parameterName, object val)
Parameters
Type Name Description
System.String parameterName
System.Object val
Returns
Type Description
System.Data.Common.DbParameter

CreateParameterSource(String, DbType, Int32, ParameterDirection, String)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
protected DbParameter CreateParameterSource(string parameterName, DbType dbType, int size, ParameterDirection dir, string sourceColumn)
Parameters
Type Name Description
System.String parameterName
System.Data.DbType dbType
System.Int32 size
System.Data.ParameterDirection dir
System.String sourceColumn
Returns
Type Description
System.Data.Common.DbParameter

CreateParameterSource(String, DbType, Int32, String)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
protected DbParameter CreateParameterSource(string parameterName, DbType dbType, int size, string sourceColumn)
Parameters
Type Name Description
System.String parameterName
System.Data.DbType dbType
System.Int32 size
System.String sourceColumn
Returns
Type Description
System.Data.Common.DbParameter

CreateParameterType(String, DbType)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
protected DbParameter CreateParameterType(string parameterName, DbType dbType)
Parameters
Type Name Description
System.String parameterName
System.Data.DbType dbType
Returns
Type Description
System.Data.Common.DbParameter

CreateReturnParameter()

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
protected DbParameter CreateReturnParameter()
Returns
Type Description
System.Data.Common.DbParameter

CreateTextCommand(String)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
protected DbCommand CreateTextCommand(string cmdText)
Parameters
Type Name Description
System.String cmdText
Returns
Type Description
System.Data.Common.DbCommand

EscapeWildcardChars(String)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
public string EscapeWildcardChars(string s)
Parameters
Type Name Description
System.String s
Returns
Type Description
System.String

GetReturnValue(DbCommand)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
protected int GetReturnValue(DbCommand cmd)
Parameters
Type Name Description
System.Data.Common.DbCommand cmd
Returns
Type Description
System.Int32

GetValue(DbCommand, String)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
protected object GetValue(DbCommand cmd, string parameterName)
Parameters
Type Name Description
System.Data.Common.DbCommand cmd
System.String parameterName
Returns
Type Description
System.Object

ProviderSpecificParameterName(String)

Returns the parameter name decorated according to the rules for the current DataFactory provider. This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
public string ProviderSpecificParameterName(string parameterName)
Parameters
Type Name Description
System.String parameterName

The parameter name that should be decorated.

Returns
Type Description
System.String

The decorated parameter name.

SetValue(DbCommand, String, Object)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
protected void SetValue(DbCommand cmd, string parameterName, object val)
Parameters
Type Name Description
System.Data.Common.DbCommand cmd
System.String parameterName
System.Object val

ToLogString(DbCommand)

Returns the database command as a string suitable for debug output. This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
public string ToLogString(DbCommand sqlCmd)
Parameters
Type Name Description
System.Data.Common.DbCommand sqlCmd

The database command object.

Returns
Type Description
System.String

A string.

ToStringEmpty(Object)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
protected string ToStringEmpty(object val)
Parameters
Type Name Description
System.Object val
Returns
Type Description
System.String

ToSystemNull(Object)

This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
protected object ToSystemNull(object val)
Parameters
Type Name Description
System.Object val
Returns
Type Description
System.Object

ValidateVersion(IDatabaseHandler)

This function ensures that old/new versions of EPiServer is not reused with an other database as of the new GAC era. This member supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
[Obsolete("Use EPiServer.Data.DatabaseVersionValidator to validate database instead.")]
public static void ValidateVersion(IDatabaseHandler handler)
Parameters
Type Name Description
IDatabaseHandler handler

Extension Methods