LEADTOOLS Medical (Leadtools.Medical.DataAccessLayer assembly)

GenerateWherePaginationStatement Method

Show in webframe





A collection of Leadtools.Medical.DataAccessLayer.Catalog.CatalogElement array to generate the SQL WHERE statement from.
The name of the System.Data.DataTable which will be queried in the database.
The primary key field of the tableName.
A field of the tableName that the results will be ordered by.
Specifies the page number and the size of the page of the query result.
An SQL statement that is the FROM clause of the original query (the a non-pagination version of the query)
Generates a SQL WHERE statement (using the given matching parameters) that returns groups of records that can be used for pagination.
Syntax
public static string GenerateWherePaginationStatement( 
   Collection<CatalogElement[]> matchingParams,
   string tableName,
   string keyField,
   string orderByField,
   QueryPageInfo queryPageInfo,
   string originalTableQuery
)
'Declaration
 
Public Shared Function GenerateWherePaginationStatement( _
   ByVal matchingParams As Collection(Of CatalogElement()), _
   ByVal tableName As String, _
   ByVal keyField As String, _
   ByVal orderByField As String, _
   ByVal queryPageInfo As QueryPageInfo, _
   ByVal originalTableQuery As String _
) As String
'Usage
 
Dim matchingParams As Collection(Of CatalogElement())
Dim tableName As String
Dim keyField As String
Dim orderByField As String
Dim queryPageInfo As QueryPageInfo
Dim originalTableQuery As String
Dim value As String
 
value = SqlProviderUtilities.GenerateWherePaginationStatement(matchingParams, tableName, keyField, orderByField, queryPageInfo, originalTableQuery)

            

            
public:
static String^ GenerateWherePaginationStatement( 
   Collection<array<CatalogElement^>>^ matchingParams,
   String^ tableName,
   String^ keyField,
   String^ orderByField,
   QueryPageInfo^ queryPageInfo,
   String^ originalTableQuery
) 

Parameters

matchingParams
A collection of Leadtools.Medical.DataAccessLayer.Catalog.CatalogElement array to generate the SQL WHERE statement from.
tableName
The name of the System.Data.DataTable which will be queried in the database.
keyField
The primary key field of the tableName.
orderByField
A field of the tableName that the results will be ordered by.
queryPageInfo
Specifies the page number and the size of the page of the query result.
originalTableQuery
An SQL statement that is the FROM clause of the original query (the a non-pagination version of the query)

Return Value

A SQL WHERE statement using the given matching parameters.
Remarks

The returned SQL statement is not guaranteed to work with all database engines. However, the statement can be used with Microsoft SQL Server engines.

The method works by combining all of the Leadtools.Medical.DataAccessLayer.Catalog.CatalogElement in each array with an AND operator and inserting an OR operator between each Leadtools.Medical.DataAccessLayer.Catalog.CatalogElement array.

The method will use the Leadtools.Medical.DataAccessLayer.Catalog.CatalogElement.EntityName property as the SQL table name and the Leadtools.Medical.DataAccessLayer.Catalog.CatalogElement.ElementName property as the SQL column name for the SQL statement.

For date-time matching, this method can handle the System.DateTime, Leadtools.Dicom.DicomDateRangeValue, Leadtools.Dicom.DicomTimeRangeValue and Leadtools.Dicom.Common.DataTypes.DateRange data types.

Any other value will be converted to a string where wild card/single character matching could be performed using the MatchAllCharacters and MatchOneCharacter methods.

If the string value contains the MatchingValueSeparator value, the values will be separated with an OR operator.

You can override the default using the WhereStatementGenerator property.

Requirements

Target Platforms

See Also

Reference

SqlProviderUtilities Class
SqlProviderUtilities Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.

Leadtools.Medical.DataAccessLayer requires a Medical toolkit server license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features