Article Details
Id: | 10751 |
Product: | finPOWER Connect |
Type: | NEW |
Version: | 1.06.06 |
Opened: | 29/11/2012 |
Closed: | 30/11/2012 |
Released: | 29/01/2013 |
Job: | J010838 |
Select Query Builder; SqlWhere.AppendRangeWithPk method updated to allow a 'NOT' range to be supplied
The ISSqlWhereBuilder business layer object has been updated to allow a 'NOT' range to be supplied to the .AppendRangeWithPk method.
The following example returns all Accounts where the Account's Account Type is not 'CC' or 'VL':
Dim dr As IDataReader
Dim sqb As ISSelectQueryBuilder
sqb = finBL.Database.CreateSelectQueryBuilder()
With sqb
.Table = "Account"
.Fields.AddList("AccountId,Name")
With .SqlWhere
.AppendRangeWithPk("Account.AccountTypePk", "AccountType", "AccountTypeId", "Pk", "CC,VL", , True)
End With
End With
If sqb.ExecuteDataReader(dr) Then
Do While dr.Read()
finBL.DebugPrint(String.Format("{0}: {1}", dr!AccountId, dr!Name))
Loop
finBL.Database.DataReaderClose(dr)
Else
Main = False
End If
The 'True' parameter on the end of the .AppendRangeWithPk method indicates that this is a 'NOT' range.