Class SqlProvider
Base class for all SQL providers.
public abstract class SqlProvider
- Inheritance
-
SqlProvider
- Derived
- Inherited Members
- Extension Methods
Fields
GlobalPrefix
Field
public const string GlobalPrefix = ":"
Field Value
Properties
AutoIncSql
Keyword, used in replacing a placeholder
public virtual string AutoIncSql { get; }
Property Value
BlobSql
Keyword, used in replacing a placeholder
public virtual string BlobSql { get; }
Property Value
BlobTextSql
Keyword, used in replacing a placeholder
public virtual string BlobTextSql { get; }
Property Value
BoolSql
Keyword, used in replacing a placeholder
public virtual string BoolSql { get; }
Property Value
CanCreateDatabases
True when this provider can create a database out of a connection string
public virtual bool CanCreateDatabases { get; }
Property Value
ConnectionStringAdapter
Returns the DbConAdapter
public DbConAdapter ConnectionStringAdapter { get; }
Property Value
ConnectionStringTemplate
The connection string template
public virtual string ConnectionStringTemplate { get; }
Property Value
DatabaseKeys
A list of strings used as database name key in connection strings.
public virtual string[] DatabaseKeys { get; }
Property Value
- string[]
DateSql
Keyword, used in replacing a placeholder
public virtual string DateSql { get; }
Property Value
DateTimeSql
Keyword, used in replacing a placeholder
public virtual string DateTimeSql { get; }
Property Value
DecimalSql
Keyword, used in replacing a placeholder
public virtual string DecimalSql { get; }
Property Value
DefaultCommandTimeoutSeconds
The default command timeout seconds
public static int DefaultCommandTimeoutSeconds { get; }
Property Value
Description
The description of this sql provider
public virtual string Description { get; }
Property Value
Factory
Returns the DbProviderFactory
public DbProviderFactory Factory { get; }
Property Value
FloatSql
Keyword, used in replacing a placeholder
public virtual string FloatSql { get; }
Property Value
LastIdSql
The SQL statement used in getting the last auto-increment ID used by the database.
public virtual string LastIdSql { get; }
Property Value
NBlobTextSql
Keyword, used in replacing a placeholder
public virtual string NBlobTextSql { get; }
Property Value
NVarcharSql
Keyword, used in replacing a placeholder
public virtual string NVarcharSql { get; }
Property Value
Name
Returns the name of this sql provider
public string Name { get; }
Property Value
NativePrefix
Returns the native prefix of SQL parameters.
public abstract string NativePrefix { get; }
Property Value
NotNullSql
Keyword, used in replacing a placeholder
public virtual string NotNullSql { get; }
Property Value
NullSql
Keyword, used in replacing a placeholder
public virtual string NullSql { get; }
Property Value
ObjectEndDelimiter
The
public virtual string ObjectEndDelimiter { get; }
Property Value
ObjectStartDelimiter
The object start delimiter
public virtual string ObjectStartDelimiter { get; }
Property Value
OidMode
The OID mode this provider supports.
public virtual OidMode OidMode { get; }
Property Value
PasswordKeys
A list of strings used as password key in connection strings.
public virtual string[] PasswordKeys { get; }
Property Value
- string[]
PositionalParameters
Returns true if the SQL parameters of this SQL provider is positional.
public virtual bool PositionalParameters { get; }
Property Value
PrimaryKeySql
Keyword, used in replacing a placeholder
public virtual string PrimaryKeySql { get; }
Property Value
ServerDateTimeSql
The keyword that can be used to return the current datetime in an SQL statement.
public virtual string ServerDateTimeSql { get; }
Property Value
ServerKeys
A list of strings used as server name key in connection strings.
public virtual string[] ServerKeys { get; }
Property Value
- string[]
ServerType
Returns the DbServerType
public DbServerType ServerType { get; }
Property Value
SuperUser
The default super user name
public virtual string SuperUser { get; }
Property Value
SuperUserPassword
The default super user password
public virtual string SuperUserPassword { get; }
Property Value
SupportedAlterTableTypes
Returns a set (bit-field) of the supported AlterTableTypes.
public virtual AlterTableType SupportedAlterTableTypes { get; }
Property Value
SupportsAutoIncFields
True when this provider supports auto-increment fields, such as MsSql and MySql
public virtual bool SupportsAutoIncFields { get; }
Property Value
SupportsGenerators
True when this provider supports generators/sequencers, such as Oracle or FirebirdSql
public virtual bool SupportsGenerators { get; }
Property Value
SupportsTransactions
True when this provider supports transactions
public virtual bool SupportsTransactions { get; }
Property Value
UserNameKeys
A list of strings used as user name key in connection strings.
public virtual string[] UserNameKeys { get; }
Property Value
- string[]
VarcharSql
Keyword, used in replacing a placeholder
public virtual string VarcharSql { get; }
Property Value
Methods
AddColumnSql(string, string)
Returns an "alter column" SQL statement.
public virtual string AddColumnSql(string TableName, string ColumnDef)
Parameters
Returns
AddForeignKeySql(string, string, string, string, string)
Returns an "alter table" SQL statement for adding a foreign key constraint
public virtual string AddForeignKeySql(string TableName, string ColumnName, string ForeignTableName, string ForeignColumnName, string ConstraintName)
Parameters
TableNamestringColumnNamestringForeignTableNamestringForeignColumnNamestringConstraintNamestring
Returns
AddUniqueConstraintSql(string, string, string)
Returns an "alter table" SQL statement for adding a unique constraint
public virtual string AddUniqueConstraintSql(string TableName, string ColumnName, string ConstraintName)
Parameters
Returns
ApplyRowLimit(string, int)
Applies a row limit to a SELECT statement.
public virtual string ApplyRowLimit(string SqlText, int RowLimit)
Parameters
Returns
BeginTransactionContext(string)
Creates a transaction context that owns both the connection and the transaction.
public virtual SqlTransactionContext BeginTransactionContext(string ConnectionString)
Parameters
ConnectionStringstring
Returns
BeginTransactionContext(DbConnectionInfo)
Creates a transaction context that owns both the connection and the transaction.
public virtual SqlTransactionContext BeginTransactionContext(DbConnectionInfo ConnectionInfo)
Parameters
ConnectionInfoDbConnectionInfo
Returns
CanConnect(string, bool)
Returns true if this connection info is valid and can connect to a database.
public bool CanConnect(string ConnectionString, bool ThrowIfNot = false)
Parameters
Returns
CanLogSql(string)
Returns true if SQL logging is enabled.
protected virtual bool CanLogSql(string SqlText)
Parameters
SqlTextstring
Returns
Concat(params string[])
Concatenates two or more strings.
Example: SELECT FirstName || LastName As FullName FROM Customers
Oracle, Firebird, SQLite: ||
MsSql, Access : +
public virtual string Concat(params string[] Parts)
Parameters
Partsstring[]
Returns
CreateCommand(DbConnection, string, params object[])
Creates a DbCommand object.
public DbCommand CreateCommand(DbConnection Connection, string SqlText, params object[] Params)
Parameters
ConnectionDbConnectionSqlTextstringParamsobject[]
Returns
CreateCommand(DbConnection, string, SqlParams)
Creates a DbCommand object.
public DbCommand CreateCommand(DbConnection Connection, string SqlText, SqlParams Params)
Parameters
ConnectionDbConnectionSqlTextstringParamsSqlParams
Returns
CreateConnection(string)
Creates a DbConnection object.
public DbConnection CreateConnection(string ConnectionString)
Parameters
ConnectionStringstring
Returns
CreateConnectionString(string, string, string, string)
Creates a connection string based on the specified server, database, user name and password.
public virtual string CreateConnectionString(string ServerName, string DatabaseName, string UserName, string Password)
Parameters
Returns
CreateConnectionStringBuilder(string)
Creates a connection string builder based on a specified connection string.
public virtual ConnectionStringBuilder CreateConnectionStringBuilder(string ConnectionString)
Parameters
ConnectionStringstring
Returns
CreateDatabase(string)
Creates a database
public virtual bool CreateDatabase(string ConnectionString)
Parameters
ConnectionStringstring
Returns
CreateDbParameter(DbCommand, SqlParam)
Creates a DbParameter object for the specified SqlParam object.
protected virtual DbParameter CreateDbParameter(DbCommand Command, SqlParam Param)
Parameters
Returns
CreateGenerator(string, string)
Creates the GeneratorName generator to the database.
public virtual void CreateGenerator(string ConnectionString, string GeneratorName)
Parameters
CreateParamMap(SqlParams)
Creates a dictionary of SqlParam objects by name.
protected virtual Dictionary<string, SqlParam> CreateParamMap(SqlParams Params)
Parameters
ParamsSqlParams
Returns
CreateSqlParams(string, params object[])
Creates a list of SQL Params based on a specified SQL statement.
public virtual SqlParams CreateSqlParams(string SqlText, params object[] Params)
Parameters
Returns
DatabaseExists(string)
Returns true if the database exists.
public virtual bool DatabaseExists(string ConnectionString)
Parameters
ConnectionStringstring
Returns
DecimalWithArgsSql(string)
Returns a string as "decimal({Args})";
protected virtual string DecimalWithArgsSql(string Args)
Parameters
Argsstring
Returns
DropColumnDefaultSql(string, string)
Returns an "alter column" SQL statement.
public virtual string DropColumnDefaultSql(string TableName, string ColumnName)
Parameters
Returns
DropColumnSql(string, string)
Returns an "alter column" SQL statement.
public virtual string DropColumnSql(string TableName, string ColumnName)
Parameters
Returns
DropForeignKeySql(string, string)
Returns an "alter table" SQL statement for dropping a foreign key constraint
public virtual string DropForeignKeySql(string TableName, string ConstraintName)
Parameters
Returns
DropNotNullSql(string, string, string)
Returns an "alter column" SQL statement.
public virtual string DropNotNullSql(string TableName, string ColumnName, string DataType)
Parameters
Returns
DropUniqueConstraintSql(string, string)
Returns an "alter table" SQL statement for dropping a unique constraint
public virtual string DropUniqueConstraintSql(string TableName, string ConstraintName)
Parameters
Returns
EnsureConnection(string)
Ensures that a connection can be done by opening and closing the connection.
public virtual void EnsureConnection(string ConnectionString)
Parameters
ConnectionStringstring
ExecSql(DbTransaction, string)
Executes a single SQL operation inside a transaction.
public int ExecSql(DbTransaction Transaction, string SqlText)
Parameters
TransactionDbTransactionSqlTextstring
Returns
ExecSql(DbTransaction, string, int, params object[])
Executes a single SQL operation inside a transaction.
public int ExecSql(DbTransaction Transaction, string SqlText, int CommandTimeout, params object[] Params)
Parameters
TransactionDbTransactionSqlTextstringCommandTimeoutintParamsobject[]
Returns
ExecSql(DbTransaction, string, params object[])
Executes a single SQL operation inside a transaction.
public int ExecSql(DbTransaction Transaction, string SqlText, params object[] Params)
Parameters
TransactionDbTransactionSqlTextstringParamsobject[]
Returns
ExecSql(string, Action<DbTransaction>)
It can be used in executin multiple SQL operations inside a single transaction using a callback.
Example
Provider.ExecSql(ConnectionString,
tr => Provider.ExecSql(tr, Sql1, Params1),
tr => Provider.ExecSql(tr, Sql2, Params2),
tr => Provider.ExecSql(tr, Sql3, Params3)
);
public void ExecSql(string ConnectionString, Action<DbTransaction> Action)
Parameters
ConnectionStringstringActionAction<DbTransaction>
ExecSql(string, IEnumerable<string>)
Executes a list of executable statements inside a single transaction
public virtual void ExecSql(string ConnectionString, IEnumerable<string> SqlTextList)
Parameters
ConnectionStringstringSqlTextListIEnumerable<string>
ExecSql(string, string)
Executes a SQL statement (INSERT, UPDATE, DELETE, κλπ) and returns the number of rows affected.
public int ExecSql(string ConnectionString, string SqlText)
Parameters
Returns
ExecSql(string, string, int, params object[])
Executes a SQL statement (INSERT, UPDATE, DELETE, κλπ) and returns the number of rows affected.
public int ExecSql(string ConnectionString, string SqlText, int CommandTimeout, params object[] Params)
Parameters
Returns
ExecSql(string, string, params object[])
Executes a SQL statement (INSERT, UPDATE, DELETE, κλπ) and returns the number of rows affected.
public int ExecSql(string ConnectionString, string SqlText, params object[] Params)
Parameters
Returns
ExecSql(DbConnectionInfo, Action<DbTransaction>)
It can be used in executin multiple SQL operations inside a single transaction using a callback.
Example
Provider.ExecSql(ConnectionString,
tr => Provider.ExecSql(tr, Sql1, Params1),
tr => Provider.ExecSql(tr, Sql2, Params2),
tr => Provider.ExecSql(tr, Sql3, Params3)
);
public void ExecSql(DbConnectionInfo ConnectionInfo, Action<DbTransaction> Action)
Parameters
ConnectionInfoDbConnectionInfoActionAction<DbTransaction>
ExecSql(DbConnectionInfo, IEnumerable<string>)
Executes a list of executable statements inside a single transaction
public virtual void ExecSql(DbConnectionInfo ConnectionInfo, IEnumerable<string> SqlTextList)
Parameters
ConnectionInfoDbConnectionInfoSqlTextListIEnumerable<string>
ExecSql(DbConnectionInfo, string)
Executes a SQL statement (INSERT, UPDATE, DELETE, κλπ) and returns the number of rows affected.
public int ExecSql(DbConnectionInfo ConnectionInfo, string SqlText)
Parameters
ConnectionInfoDbConnectionInfoSqlTextstring
Returns
ExecSql(DbConnectionInfo, string, params object[])
Executes a SQL statement (INSERT, UPDATE, DELETE, κλπ) and returns the number of rows affected.
public int ExecSql(DbConnectionInfo ConnectionInfo, string SqlText, params object[] Params)
Parameters
ConnectionInfoDbConnectionInfoSqlTextstringParamsobject[]
Returns
FindParam(Dictionary<string, SqlParam>, string, string)
Finds a SqlParam object by name.
protected virtual SqlParam FindParam(Dictionary<string, SqlParam> Map, string Name, string SqlText)
Parameters
MapDictionary<string, SqlParam>NamestringSqlTextstring
Returns
FormatSqlLogValue(object)
Formats a SQL parameter value for logging.
protected virtual string FormatSqlLogValue(object Value)
Parameters
Valueobject
Returns
FormatSqlParameters(DbParameterCollection)
Formats SQL parameters for logging.
protected virtual string FormatSqlParameters(DbParameterCollection Parameters)
Parameters
ParametersDbParameterCollection
Returns
GeneratorExists(string, string)
Returns true if the GeneratorName exists in a database.
public virtual bool GeneratorExists(string ConnectionString, string GeneratorName)
Parameters
Returns
GetDatabaseName(string)
Gets the database name from a connection string.
public virtual string GetDatabaseName(string ConnectionString)
Parameters
ConnectionStringstring
Returns
GetNativeParameterName(string)
Gets the native parameter name for the specified parameter name, e.g. NativePrefix + Name
protected virtual string GetNativeParameterName(string Name)
Parameters
Namestring
Returns
GetServerDateTime(string)
Returns the current date and time of the database server
public virtual DateTime GetServerDateTime(string ConnectionString)
Parameters
ConnectionStringstring
Returns
GetServerDateTime(DbConnectionInfo)
Returns the current date and time of the database server
public virtual DateTime GetServerDateTime(DbConnectionInfo ConnectionInfo)
Parameters
ConnectionInfoDbConnectionInfo
Returns
GetSqlParameterToken(string)
Gets the SQL parameter token for the specified parameter name, e.g. "?" for positional paramer or NativePrefix + Name.
protected virtual string GetSqlParameterToken(string Name)
Parameters
Namestring
Returns
IntegerResult(DbTransaction, string, int, int, params object[])
Ideal for executing SELECT statements of the type "select count(ID) as COUNT_ID from TABLE_NAME where ID = 1234"
public int IntegerResult(DbTransaction Transaction, string SqlText, int CommandTimeout, int Default, params object[] Params)
Parameters
TransactionDbTransactionSqlTextstringCommandTimeoutintDefaultintParamsobject[]
Returns
IntegerResult(string, string, int)
Ideal for executing SELECT statements of the type "select count(ID) as COUNT_ID from TABLE_NAME where ID = 1234"
public int IntegerResult(string ConnectionString, string SqlText, int Default)
Parameters
Returns
IntegerResult(string, string, int, params object[])
Ideal for executing SELECT statements of the type "select count(ID) as COUNT_ID from TABLE_NAME where ID = 1234"
public int IntegerResult(string ConnectionString, string SqlText, int Default, params object[] Params)
Parameters
Returns
LastId(DbTransaction, string)
Returns the last id produced by an INSERT Sqlt statement.
It should be used only with databases that support identity (auto-increment) columns
public virtual int LastId(DbTransaction Transaction, string TableName)
Parameters
TransactionDbTransactionTableNamestring
Returns
Log(Exception, string, object[], MemTable)
Logs an exception.
protected virtual void Log(Exception e, string SqlText, object[] Params, MemTable Table = null)
Parameters
LogSql(DbCommand)
Logs a SQL statement.
protected virtual void LogSql(DbCommand Command)
Parameters
CommandDbCommand
NextIdByGenerator(DbTransaction, string)
Returns the next value of the GeneratorName generator.
public virtual int NextIdByGenerator(DbTransaction Transaction, string GeneratorName)
Parameters
TransactionDbTransactionGeneratorNamestring
Returns
NormalizeConnectionString(string)
Normalizes a connection string.
public virtual string NormalizeConnectionString(string ConnectionString)
Parameters
ConnectionStringstring
Returns
NormalizeRowLimit(int)
Normalizes RowLimit. If it is less than zero it returns a default limit value.
public int NormalizeRowLimit(int RowLimit)
Parameters
RowLimitint
Returns
OpenConnection(string)
Creates and opens a DbConnection
public virtual DbConnection OpenConnection(string ConnectionString)
Parameters
ConnectionStringstring
Returns
OpenConnection(DbConnectionInfo)
Creates and opens a DbConnection
public virtual DbConnection OpenConnection(DbConnectionInfo ConnectionInfo)
Parameters
ConnectionInfoDbConnectionInfo
Returns
PrepareCommand(DbCommand, string, SqlParams)
Prepares a DbCommand object for the specified SQL text and parameters.
protected virtual void PrepareCommand(DbCommand Command, string SqlText, SqlParams Params)
Parameters
QSDate(DateTime)
Quotes and formats a date value as a string, properly for use with an Sql statement
public virtual string QSDate(DateTime Value)
Parameters
ValueDateTime
Returns
QSDateTime(DateTime)
Quotes and formats a date-time value as a string, properly for use with an Sql statement
public virtual string QSDateTime(DateTime Value)
Parameters
ValueDateTime
Returns
QuoteName(string)
Quote a string for use in a SQL statement.
public virtual string QuoteName(string Name)
Parameters
Namestring
Returns
RenameColumnSql(string, string, string)
Returns an "alter column" SQL statement.
public virtual string RenameColumnSql(string TableName, string ColumnName, string NewColumnName)
Parameters
Returns
ReplaceDataTypePlaceholders(string)
Replaces data type placeholders in a SQL statement with the appropriate SQL data type.
public virtual string ReplaceDataTypePlaceholders(string SqlText)
Parameters
SqlTextstring
Returns
ReplaceDecimalPlaceholders(string)
Replaces the decimal placeholder whih the decimal with the specified number of decimal places.
protected virtual string ReplaceDecimalPlaceholders(string SqlText)
Parameters
SqlTextstring
Returns
Select(DbTransaction, string, int, params object[])
Executes a SELECT statement inside a transaction and returns the result as a DataTable.
public MemTable Select(DbTransaction Transaction, string SqlText, int CommandTimeout, params object[] Params)
Parameters
TransactionDbTransactionSqlTextstringCommandTimeoutintParamsobject[]
Returns
Select(string, string)
Executes a SELECT statement and returns the result as a DataTable.
public MemTable Select(string ConnectionString, string SqlText)
Parameters
Returns
Select(string, string, int, params object[])
Executes a SELECT statement and returns the result as a DataTable.
public MemTable Select(string ConnectionString, string SqlText, int CommandTimeout, params object[] Params)
Parameters
Returns
Select(string, string, params object[])
Executes a SELECT statement and returns the result as a DataTable.
public MemTable Select(string ConnectionString, string SqlText, params object[] Params)
Parameters
Returns
Select(DbConnectionInfo, string)
Executes a SELECT statement and returns the result as a DataTable.
public MemTable Select(DbConnectionInfo ConnectionInfo, string SqlText)
Parameters
ConnectionInfoDbConnectionInfoSqlTextstring
Returns
Select(DbConnectionInfo, string, params object[])
Executes a SELECT statement and returns the result as a DataTable.
public MemTable Select(DbConnectionInfo ConnectionInfo, string SqlText, params object[] Params)
Parameters
ConnectionInfoDbConnectionInfoSqlTextstringParamsobject[]
Returns
SelectForUpdate(DbTransaction, string, string, int, object)
Selects and locks a single row for update inside a transaction.
public DataRow SelectForUpdate(DbTransaction Transaction, string TableName, string FieldName, int CommandTimeout, object FieldValue)
Parameters
TransactionDbTransactionTableNamestringFieldNamestringCommandTimeoutintFieldValueobject
Returns
SelectForUpdate(DbTransaction, string, string, object)
Selects and locks a single row for update inside a transaction.
public DataRow SelectForUpdate(DbTransaction Transaction, string TableName, string FieldName, object FieldValue)
Parameters
TransactionDbTransactionTableNamestringFieldNamestringFieldValueobject
Returns
SelectForUpdateSql(string, string)
Returns a SELECT statement that locks a single row for update.
public virtual string SelectForUpdateSql(string TableName, string FieldName)
Parameters
Returns
SelectIncrementLocked(DbTransaction, string, string, object, string, int)
Selects a row with update lock, increments an integer field, and returns the initial row.
public virtual DataRow SelectIncrementLocked(DbTransaction Transaction, string TableName, string KeyFieldName, object KeyValue, string ValueFieldName, int CommandTimeout)
Parameters
TransactionDbTransactionTableNamestringKeyFieldNamestringKeyValueobjectValueFieldNamestringCommandTimeoutint
Returns
SelectIncrementLocked(string, string, string, object, string, int)
Selects a row with update lock, increments an integer field, and returns the initial row.
public virtual DataRow SelectIncrementLocked(string ConnectionString, string TableName, string KeyFieldName, object KeyValue, string ValueFieldName, int CommandTimeout)
Parameters
ConnectionStringstringTableNamestringKeyFieldNamestringKeyValueobjectValueFieldNamestringCommandTimeoutint
Returns
SelectIncrementLocked(DbConnectionInfo, string, string, object, string)
Selects a row with update lock, increments an integer field, and returns the initial row.
public virtual DataRow SelectIncrementLocked(DbConnectionInfo ConnectionInfo, string TableName, string KeyFieldName, object KeyValue, string ValueFieldName)
Parameters
ConnectionInfoDbConnectionInfoTableNamestringKeyFieldNamestringKeyValueobjectValueFieldNamestring
Returns
SelectResult(DbTransaction, string, int, object, params object[])
Ideal for executing SELECT statements of the type "select FIELD_NAME from TABLE_NAME"
public object SelectResult(DbTransaction Transaction, string SqlText, int CommandTimeout, object Default, params object[] Params)
Parameters
TransactionDbTransactionSqlTextstringCommandTimeoutintDefaultobjectParamsobject[]
Returns
SelectResult(string, string)
Ideal for executing SELECT statements of the type "select FIELD_NAME from TABLE_NAME"
public object SelectResult(string ConnectionString, string SqlText)
Parameters
Returns
SelectResult(string, string, object)
Ideal for executing SELECT statements of the type "select FIELD_NAME from TABLE_NAME"
public object SelectResult(string ConnectionString, string SqlText, object Default)
Parameters
Returns
SelectResult(string, string, object, params object[])
Ideal for executing SELECT statements of the type "select FIELD_NAME from TABLE_NAME"
public object SelectResult(string ConnectionString, string SqlText, object Default, params object[] Params)
Parameters
Returns
SelectResults(DbTransaction, string, int, params object[])
Executes SqlText and returns the first DataRow of the result set.
WARNING: If SqlText returns no rows at all then this method returns null.
Params can be:
1. either a comma separated C# params list
2. or the Params[0] element, that is the first element in Params, may be a DataRow, generic IDictionary, IList or Array and in that case no other Params elements are used.
public DataRow SelectResults(DbTransaction Transaction, string SqlText, int CommandTimeout, params object[] Params)
Parameters
TransactionDbTransactionSqlTextstringCommandTimeoutintParamsobject[]
Returns
SelectResults(string, string)
Executes SqlText and returns the first DataRow of the result set.
WARNING: If SqlText returns no rows at all then this method returns null.
public DataRow SelectResults(string ConnectionString, string SqlText)
Parameters
Returns
SelectResults(string, string, params object[])
Executes SqlText and returns the first DataRow of the result set.
WARNING: If SqlText returns no rows at all then this method returns null.
Params can be:
1. either a comma separated C# params list
2. or the Params[0] element, that is the first element in Params, may be a DataRow, generic IDictionary, IList or Array and in that case no other Params elements are used.
public DataRow SelectResults(string ConnectionString, string SqlText, params object[] Params)
Parameters
Returns
SelectTo(DbTransaction, MemTable, string, int, params object[])
Executes a SELECT statement and loads the result into the specified DataTable using a transaction.
public int SelectTo(DbTransaction Transaction, MemTable Table, string SqlText, int CommandTimeout, params object[] Params)
Parameters
TransactionDbTransactionTableMemTableSqlTextstringCommandTimeoutintParamsobject[]
Returns
SelectTo(string, MemTable, string, int, params object[])
Executes a SELECT statement and loads the result into the specified DataTable.
public int SelectTo(string ConnectionString, MemTable Table, string SqlText, int CommandTimeout, params object[] Params)
Parameters
Returns
SelectTo(string, MemTable, string, params object[])
Executes a SELECT statement and loads the result into the specified DataTable.
public int SelectTo(string ConnectionString, MemTable Table, string SqlText, params object[] Params)
Parameters
Returns
SelectTo(DbConnectionInfo, MemTable, string)
Executes a SELECT statement and loads the result into the specified DataTable.
public int SelectTo(DbConnectionInfo ConnectionInfo, MemTable Table, string SqlText)
Parameters
ConnectionInfoDbConnectionInfoTableMemTableSqlTextstring
Returns
SelectTo(DbConnectionInfo, MemTable, string, params object[])
Executes a SELECT statement and loads the result into the specified DataTable.
public int SelectTo(DbConnectionInfo ConnectionInfo, MemTable Table, string SqlText, params object[] Params)
Parameters
ConnectionInfoDbConnectionInfoTableMemTableSqlTextstringParamsobject[]
Returns
SetColumnDefaultSql(string, string, string)
Returns an "alter column" SQL statement.
public virtual string SetColumnDefaultSql(string TableName, string ColumnName, string DefaultExpression)
Parameters
Returns
SetColumnLengthSql(string, string, string, string, string)
Returns an "alter column" SQL statement.
public virtual string SetColumnLengthSql(string TableName, string ColumnName, string DataType, string Required, string DefaultExpression)
Parameters
Returns
SetDefaultBeforeNotNullUpdateSql(string, string, string, bool)
Returns an "UPDATE" statement for setting the default value to a column when it is null, i.e. where ColumnName is null.
To be used before setting a "not null" constraint to a column.
public virtual string SetDefaultBeforeNotNullUpdateSql(string TableName, string ColumnName, string DefaultExpression, bool IsString)
Parameters
Returns
SetGeneratorTo(string, string, int)
Attempts to set a generator/sequencer to Value.
DANGEROOUS.
public virtual void SetGeneratorTo(string ConnectionString, string GeneratorName, int Value)
Parameters
SetNotNullSql(string, string, string)
Returns an "alter column" SQL statement.
public virtual string SetNotNullSql(string TableName, string ColumnName, string DataType)
Parameters
Returns
SetTableGeneratorTo(string, string, int)
Attempts to set a generator/sequencer or identity column to Value.
VERY DANGEROOUS.
public virtual void SetTableGeneratorTo(string ConnectionString, string TableName, int Value)
Parameters
SupportsAlterTableType(AlterTableType)
Returns true if this provider supports a specified AlterTableType
public virtual bool SupportsAlterTableType(AlterTableType AlterType)
Parameters
AlterTypeAlterTableType
Returns
WaitUntilDatabaseReady(string, int, int)
Waits until the database is ready.
public virtual bool WaitUntilDatabaseReady(string ConnectionString, int RetryCount = 10, int DelayMilliseconds = 1000)