Get a new (empty) instance of a SQLBuilder for this DOCollection.
| C# | Visual Basic | Visual C++ |
public SQLBuilder GetSqlBuilder()
Public Function GetSqlBuilder As SQLBuilder
public: SQLBuilder^ GetSqlBuilder()
A correctly configured empty SQLBuilder for this DOCollection
The following is an example of GetSqlBuilder being used within a FindBy method of a StudentCollection:
Public Sub FindByStudentName(ByVal name As String)
Dim mySql As SQLBuilder = MyBase.GetSqlBuilder()
mySql.addWhere(Student.Columns.Name, name)
MyBase.SetCurrentQuery(mySql)
MyBase.find()
End SubGetSqlBuilder can also be called externally, for example:
Dim sColl as New StudentCollection Dim mySql as SQLBuilder = sColl.GetSqlBuilder() mySql.addWhere(Student.Columns.Name, name) sColl.SetCurrentQuery(mySql) sColl.Find()
In the above examples, the call to GetSqlBuilder() is the equivalent of calling:
Dim mySQL as New SQLBuilder("Student")
The GetSqlBuilder method differs from the GetCurrentQuery method in that GetSqlBuilder returns a new or empty instance of a SQLBuilder, whereas GetCurrentQuery returns the SQLBuilder that has been previously set in the DOCollection using the SetCurrentQuery method or if none exists, it will provide a new one.