Click or drag to resize

TaskDatabaseHelper Class

Helper class to perform database operations (load, create and insert tables, execute SQL statements), used from Razor scripts of report tasks
Inheritance Hierarchy
SystemObject
  Seal.HelpersTaskDatabaseHelper

Namespace: Seal.Helpers
Assembly: SealLibrary (in SealLibrary.dll) Version: 10.0.1.0+a44cd3a7f03c2bf3cdbd971a878c679e40bed08a
Syntax
C#
public class TaskDatabaseHelper

The TaskDatabaseHelper type exposes the following members.

Constructors
 NameDescription
Public methodTaskDatabaseHelperInitializes a new instance of the TaskDatabaseHelper class
Top
Methods
 NameDescription
Public methodAreRowsIdentical Returns true if two rows have identical values
Public methodAreTablesIdentical Returns true if two tables have identical rows and values
Public methodCreateTable Drop and create a table in the database from a DataTable definition
Public methodDetectAndConvertTypes Detect the column types (integer, double, date time) of a source table containing string columns and return a new table with converted values
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodExecuteCommand Execute a DbCommand (the command is traced in the DebugLog if DebugMode is true)
Public methodExecuteNonQuery(MetaConnection, String, String) Execute a SQL statement on a MetaConnection. Several statements may be executed using a commands separator.
Public methodExecuteNonQuery(ConnectionType, String, String, String, DbConnection) Execute a SQL statement on a connection. Several statements may be executed using a commands separator.
Public methodExecuteScalar(MetaConnection, String) Execute a SQL statement on a MetaConnection and return the first column of the first row of the result
Public methodExecuteScalar(ConnectionType, String, String, DbConnection) Execute a SQL statement on a connection and return the first column of the first row of the result
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetDatabaseName Returns a valid database object name from a given name: invalid characters are replaced and the name is quoted according to the current database type
Public methodGetDbCommand Returns a DbCommand created from a DbConnection
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetInsertCommand Returns the final INSERT command with the insert start and end commands added
Public methodGetTableColumnName Returns the database column name of a column (uses MyGetTableColumnName if defined)
Public methodGetTableColumnNames Returns the comma-separated list of column names of a table (uses MyGetTableColumnNames if defined)
Public methodGetTableColumnType Returns the database column type of a column (uses MyGetTableColumnType if defined)
Public methodGetTableColumnValue Returns the SQL value of a column of a row for an INSERT statement (uses MyGetTableColumnValue if defined)
Public methodGetTableColumnValues Returns the comma-separated list of values of a row for an INSERT statement (uses MyGetTableColumnValues if defined)
Public methodGetTableCreateCommand Returns the CREATE TABLE command for a DataTable (uses MyGetTableCreateCommand if defined)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodInsertTable Insert the rows of a DataTable in the database table within a transaction (rows may be deleted first)
Public methodIsNumeric Returns true if the column has a numeric type
Public methodIsRowEmpty Returns true if a row of an Excel worksheet is empty
Public methodLoadDataTable(MetaConnection, String) Load a DataTable from a MetaConnection using a SQL SELECT statement
Public methodLoadDataTable(ConnectionType, String, String, DbConnection) Load a DataTable from a connection using a SQL SELECT statement (an open connection may be provided)
Public methodLoadDataTableFromCSV Load a DataTable from a CSV file
Public methodLoadDataTableFromCSVVBParser Load a DataTable from a CSV file using the Microsoft Visual Basic Parser
Public methodLoadDataTableFromExcel Load a DataTable from an Excel tab. A start row, and/or column can be specified. An end row and/or column can be specified.
Public methodLoadStringList Load a list of strings from a MetaConnection using a SQL SELECT statement (first column of the result)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodOdbcLoadDataTable Load a DataTable from an ODBC connection using a SQL SELECT statement
Public methodRawInsertTable Insert rows given as arrays of SQL literal values in a database table within a transaction (rows may be deleted first)
Public methodRootGetTableColumnName Default implementation to get the database column name of a column
Public methodRootGetTableColumnNames Default implementation to build the comma-separated list of column names of a table
Public methodRootGetTableColumnType Default implementation to get the database column type of a column
Public methodRootGetTableColumnValue Default implementation to get the SQL value of a column of a row for an INSERT statement
Public methodRootGetTableColumnValues Default implementation to build the comma-separated list of values of a row for an INSERT statement
Public methodRootGetTableCreateCommand Default implementation to build the CREATE TABLE command for a DataTable
Public methodSetDatabaseDefaultConfiguration Set the default configuration values (column types, insert commands) for a given database type
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Fields
 NameDescription
Public fieldColumnCharLength 0 = means auto size
Public fieldColumnCharType Database column type used for character columns (if empty, the default of the current database type is used)
Public fieldColumnDateTimeType Database column type used for date time columns (if empty, the default of the current database type is used)
Public fieldColumnIntegerType Database column type used for integer columns (if empty, the default of the current database type is used)
Public fieldColumnNumericType Database column type used for numeric columns (if empty, the default of the current database type is used)
Public fieldDatabaseType Current database type used for the default configuration (set by SetDatabaseDefaultConfiguration)
Public fieldDebugLog Log of the SQL commands executed when DebugMode is true
Public fieldDebugMode If true, the SQL commands executed are traced in the DebugLog
Public fieldDefaultEncoding Default encoding used to load CSV files
Public fieldExecuteTimeout Command timeout in seconds used to execute statements (0 means no timeout)
Public fieldInsertBurstSize Number of rows inserted per INSERT batch
Public fieldInsertEndCommand Statement added after the INSERT commands (if empty, the default of the current database type is used, e.g. 'end;' for Oracle)
Public fieldInsertStartCommand Statement added before the INSERT commands (if empty, the default of the current database type is used, e.g. 'begin' for Oracle)
Public fieldInsertTableHints Optional table hints for insert
Public fieldLoadBurstSize 0 = Load all records in one
Public fieldLoadSortColumn Sort column used if LoadBurstSize is specified
Public fieldMaxDecimalNumber If set, limit the number of decimals for numeric values
Public fieldMyDetectAndConvertTypes If set, custom delegate used instead of the default implementation to detect column types and convert the values of a table
Public fieldMyGetTableColumnName If set, custom delegate used instead of the default implementation to get a database column name
Public fieldMyGetTableColumnNames If set, custom delegate used instead of the default implementation to build the list of column names
Public fieldMyGetTableColumnType If set, custom delegate used instead of the default implementation to get a database column type
Public fieldMyGetTableColumnValue If set, custom delegate used instead of the default implementation to get the SQL value of a column for an INSERT statement
Public fieldMyGetTableColumnValues If set, custom delegate used instead of the default implementation to build the list of values of a row for an INSERT statement
Public fieldMyGetTableCreateCommand If set, custom delegate used instead of the default implementation to build the CREATE TABLE command
Public fieldMyLoadDataTable If set, custom delegate used instead of the default implementation to load a DataTable from a connection
Public fieldMyLoadDataTableFromCSV If set, custom delegate used instead of the default implementation to load a DataTable from a CSV file
Public fieldMyLoadDataTableFromExcel If set, custom delegate used instead of the default implementation to load a DataTable from an Excel file
Public fieldNoRowsCharLength Char length taken if the table loaded as no row
Public fieldRemoveCrLf If true, carriage returns and line feeds are replaced by spaces in text values before insert
Public fieldSelectTimeout Command timeout in seconds used for SELECT statements (0 means no timeout)
Public fieldTableLoadDetectAndConvertTypes If true, column types can be detected and values converted during a table load to database (For CSV and Excel load)
Public fieldTrimText If true, text values are trimmed before insert
Public fieldUseDbDataAdapter If true, a DbDataAdapter is used to fill the DataTable instead of a DataReader
Public fieldUseMultiRowsInsert /If true, insert command is built with multi rows
Top
See Also