[This is preliminary documentation and is subject to change.]
Encapsulates a field name and type from a DbType
| C# | Visual Basic | Visual C++ |
public class SQLField
Public Class SQLField
public ref class SQLField
| All Members | Constructors | Methods | Properties | ||
| Icon | Member | Description |
|---|---|---|
| SQLFieldSQLFieldNew(String, DbType) | Constructor | |
| DbType | ||
| Name | ||
| Render(String) | Render a field value given the System.Data.DbType enum value passed to the constructor | |
| RenderDate(String) | Render a field value as a date | |
| RenderGuid(String) | Render a field value as a date | |
| RenderNumeric(String) | Render a field value as a number | |
| RenderString(String) | Render a field value as a string | |
| RenderTime(String) | Render a field value as a time |
When preparing a dictionary to be passed to the SQLQueryFormatter.format
method, the caller must map ElementDef constants to instances of SQLField.
The DbType enum value is used to render the field according to its data
type (e.g. strings are quoted with a single quote, numeric fields are rendered
as-is, etc.)
For example,
CopyC#
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' )"
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 ) ;
| Object | |
| SQLField | |