SIFWorks ADK 2.0
SQLQueryFormatter Class
NamespacesEdustructures.SifWorks.Tools.QuerySQLQueryFormatter

[This is preliminary documentation and is subject to change.]

An implementation of a QueryFormatter that formats queries for inclusion in an SQL WHERE clause.
Declaration Syntax
C#Visual BasicVisual C++
public class SQLQueryFormatter : QueryFormatter
Public Class SQLQueryFormatter _
	Inherits QueryFormatter
public ref class SQLQueryFormatter : public QueryFormatter
Members
All MembersConstructorsMethods



IconMemberDescription
SQLQueryFormatterSQLQueryFormatterNew()()
GetOperator(ComparisonOperators)
Return the text that should be inserted for a logical AND operation
(Overrides QueryFormatter.GetOperator(ComparisonOperators).)
GetOperator(GroupOperator) (Overrides QueryFormatter.GetOperator(GroupOperator).)
RenderField(IElementDef, Object)
Return the text for a field name
(Overrides QueryFormatter.RenderField(IElementDef, Object).)
RenderValue(String, Object)
Return the text for a field value
(Overrides QueryFormatter.RenderValue(String, Object).)
Remarks
When preparing a dictionary to be passed to the SQLQueryFormatter.format method, the caller must map ElementDef constants to instances of the SQLField class. The constructor to that class requires two parameters: the application- defined name of the field, and a constant from the DbType class, which instructs the SQLQueryFormatter how to render the field value in the query string (e.g. strings are quoted with a single quote, numeric fields are rendered as-is, etc.)
Examples
For example,
CopyC#
IDictionary m = new Hashtable();
m[ SIFDTD.STUDENTPERSONAL_REFID ] =
    new SQLField( "Students.Foreign_ID", DbType.String ) ;
m[ SIFDTD.NAME_LASTNAME ],
    new SQLField( "Students.Last_Name",  DbType.String ) ;
m[ SIFDTD.NAME_FIRSTNAME ],
    new SQLField( "First_Name", DbType.String ) ;
m[ SIFDTD.DEMOGRAPHICS_CITIZENSHIPSTATUS ],
    new SQLField( "Students.US_Citizen_Bool{04=1,=0}", DbType.Int32 ) ;
The above example might result in a string such as "( Students.US_Citizen_Bool = 0 )" or "( Students.Foreign_ID = '898' ) OR ( Students.Last_Name = 'Cortez' AND First_Name = 'Robert' )"
Inheritance Hierarchy
Object
QueryFormatter
 SQLQueryFormatter

Assembly: Edustructures.SifWorks.Adk (Module: Edustructures.SifWorks.Adk) Version: 2.0.0.10