FieldExpression Class

From RemObjects Wiki

Jump to:navigation, search
.NET Platform Header-48.png

This is a Data Abstract for .NET Library topic

Please do not modify the page structure, but feel free to modify/add text.

ClassesProtocolsEnums

Contents

Overview

This class is used to represent data table fields in Dynamic Where expressions. For example, see how the database field ID is represented in the SQL query WHERE clause and in the equal Dynamic Where expression:

SELECT * FROM Employees WHERE (ID=42)

WhereExpression where = new RemObjects.DataAbstract.Expressions.BinaryExpression(
                          new RemObjects.DataAbstract.Expressions.FieldExpression("ID"), 
                          new RemObjects.DataAbstract.Expressions.ConstantExpression(42), 
                          RemObjects.DataAbstract.Expressions.BinaryOperator.Equal);


Location


Properties

FieldName

Name of the database field represented by this instance.


Prism:   property FieldName: String read write
C#:   String FieldName { get; set; }
VB:   Property FieldName As String

Kind

The kind of WhereExpression. For this class, it equals WhereKind.Field.


Prism:   property Kind: WhereKind read
C#:   WhereKind Kind { get; }
VB:   Property ReadOnly Kind As WhereKind

TableName


Prism:   property TableName: String read write
C#:   String TableName { get; set; }
VB:   Property TableName As String


Instance Methods

constructor ()

Creates a new instance of the FieldExpression class. Note that you have to set at least the FieldName property to be able to use this instance in Dynamic Where expressions.


Prism:   constructor
C#:   constructor()
VB:   Sub New

constructor (String)

Creates a new instance of the FieldExpression class and sets its FieldName property.


Prism:   constructor(aFieldName: String)
C#:   constructor(String aFieldName)
VB:   Sub New (aFieldName As String)


Parameters:

  • aFieldName: Name of the database field represented by this instance


constructor (String, String)


Prism:   constructor(aTableName: String; aFieldName: String)
C#:   constructor(String aTableName, String aFieldName)
VB:   Sub New (aTableName As String, aFieldName As String)


Parameters:

  • aTableName:
  • aFieldName:
ReadFromXml

Deserializes the field expression from the provided XmlNode. The node value (its InnerText) is assigned to the FieldName property. If the node contains the attribute tablename, its value is assigned to the TableName property.


Prism:   method ReadFromXml(xr: XmlNode)
C#:   void ReadFromXml(XmlNode xr)
VB:   Sub ReadFromXml(xr As XmlNode)


Parameters:

  • xr: XmlNode containing the serialized FieldExpression instance


ToSQLString

Creates an SQL representation of this FieldExpression instance and appends it to the provided StringBuilder.

For example, this method call

(new FieldExpression("ClassName")).ToSQLString(someStringBuilder)

will result in appending the string "ClassName" to someStringBuilder.


Prism:   method ToSQLString(dest: StringBuilder)
C#:   void ToSQLString(StringBuilder dest)
VB:   Sub ToSQLString(dest As StringBuilder)


Parameters:

  • dest: StringBuilder instance to which the SQL representation of this instance will be appended.


WriteToXml

Serializes this FieldExpression instance into an XmlElement and appends it as a child to the provided XmlNode.

While the serialized FieldName property is saved as text node, the TableName property (if assigned) is saved as attribute tablename of this XmlNode.


Prism:   method WriteToXml(sw: XmlNode)
C#:   void WriteToXml(XmlNode sw)
VB:   Sub WriteToXml(sw As XmlNode)


Parameters:

  • sw: XmlNode to which the serialization result will be appended.



See Also


Da-48.png

Product: RemObjects Data Abstract
Available Editions: Data Abstract for .NET, Delphi and Xcode

GlossaryArchitectureArticlesFeaturesLibrarySamples

Navigation
products
hubs
special
Toolbox