Click or drag to resize
Query Class
The Query class provides methods to craft an individual query against the database. The typical pattern for using this class is through the 'Database'. Typically it would not be initialised directly. Note that this is a stub class that a driver will extend and complete as required for individual database types. Individual drivers could add additional methods, but this is discouraged to ensure that the API is the same for all database types.
Inheritance Hierarchy

Namespace:  DataTables
Assembly:  DataTables (in DataTables.dll) Version: 1.6.5.0 (1.6.5.0)
Syntax
C#
public abstract class Query

The Query type exposes the following members.

Constructors
  NameDescription
Protected methodQuery
Query instance construtor. Should be called by the Database class methods rather than direction initialisation.
Top
Methods
  NameDescription
Protected method_BuildField
Create a comma separated field list
Protected method_BuildJoin
Create a JOIN satement list
Protected method_BuildLimit
Create the LIMIT / OFFSET string. Default is to create a MySQL and Postgres style statement. Drivers can override
Protected method_BuildOrder
Create the ORDER BY statement
Protected method_BuildSet
Create a set list
Protected method_BuildTable
Create the table list
Protected method_BuildValue
Create a bind field balue list
Protected method_BuildWhere
Create the WHERE statement
Protected method_Delete
Execute a DELETE statement from the current configuration
Protected method_Exec
Execute the query. Provided by the driver
Protected method_Insert
Execute an INSERT statement from the current configuration
Protected method_Prepare
Prepare the SQL query by populating the bound variables. Provided by the driver
Protected method_ProtectIdentifiers
Protect field names
Protected method_Raw
Execute a given statement
Protected method_SafeBind
The characters that can be used to bind a value are quite limited. We need to abstract this out to allow slightly more complex expressions including dots for easy aliasing
Protected method_Select
Execute an SELECT statement from the current configuration
Protected method_Update
Execute a UPDATE statement from the current configuration
Protected method_Where
Add an individual where condition to the query
Protected method_WhereGroup
Add parentheses to a where condition
Public methodAndWhere(ActionQuery)
Where query - Bound to the previous condition (if there is one) as an AND statement
Public methodAndWhere(DictionaryString, Object, String, Boolean)
Where query - Bound to the previous condition (if there is one) as an AND statement
Public methodAndWhere(String, IEnumerableObject, String, Boolean)
Where query - Bound to the previous condition (if there is one) as an AND statement
Public methodAndWhere(String, Object, String, Boolean)
Where query - Bound to the previous condition (if there is one) as an AND statement
Public methodBind
Bind a value for safe SQL execution
Public methodStatic memberCommit
Commit a transaction
Public methodDistinct
Set a distinct flag for a `select` query. Note that this has no effect on any other query type.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExec
Execute the setup query
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGet(IEnumerableString)
Add one or more get (select) field
Public methodGet(String)
Add one or more get (select) field
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberInit
Method that can be used by the database driver to run commands on first connect
Public methodJoin
Perform a JOIN operation
Public methodLimit
Limit the result set to a certain size
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOffset
Offset the return set by a given number of records (useful for paging).
Public methodOrder(IEnumerableString)
Order by
Public methodOrder(String)
Order by
Public methodOrWhere(ActionQuery)
Where query - Bound to the previous condition (if there is one) as an OR statement
Public methodOrWhere(DictionaryString, Object, String, Boolean)
Where query - Bound to the previous condition (if there is one) as an OR statement
Public methodOrWhere(String, IEnumerableObject, String, Boolean)
Where query - Bound to the previous condition (if there is one) as an OR statement
Public methodOrWhere(String, Object, String, Boolean)
Where query - Bound to the previous condition (if there is one) as an OR statement
Public methodPkey
Get the primary key column name(s) that have been set for an insert
Public methodPkey(String)
Set the primary key column names for an insert, so the inserted value can be retrieved in the result.
Public methodStatic memberRollback
Rollback the database state to the start of the transaction
Public methodSet(DictionaryString, Object, Boolean)
Set one or more fields to their given values
Public methodSet(String, Object, Boolean)
Set a single field to a given value
Public methodTable(ListString)
Set table(s) to perform the query on
Public methodTable(String)
Set table(s) to perform the query on
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodStatic memberTransaction
Start a new transaction
Public methodWhere(ActionQuery)
Where query - Bound to the previous condition (if there is one) as an AND statement
Public methodWhere(DictionaryString, Object, String, Boolean)
Where query - Bound to the previous condition (if there is one) as an AND statement
Public methodWhere(String, IEnumerableObject, String, Boolean)
Where query - Bound to the previous condition (if there is one) as an AND statement
Public methodWhere(String, Object, String, Boolean)
Where query - Bound to the previous condition (if there is one) as an AND statement
Public methodWhereGroup(Boolean, String) Obsolete.
Provide grouping for WHERE conditions.
Public methodWhereGroup(ActionQuery, String)
Provide grouping for WHERE conditions.
Top
See Also