HomeActive Query BuilderRemoving an expression from list of select fields

Removing an expression from list of select fields

I am able to remove a field/column from a select list when it is just a single field like
select Product.Id, Product.Name
from Product
Then I can remove for instance Product.Name by using UnionSubQuery.CriteriaList.RemoveFields(tableQN, columnQN);

But, when the column is an expression like
select Product.Id, CAST(Product.Id AS Varchar) + ' ' + ProductInfo.Name AS Product

how can I remove [CAST(Product.Id AS Varchar) + ' ' + ProductInfo.Name AS Product] from the select list
I now have columns from two tables in the same select column.
Thomas Schjerpen | email
August 14 2009, 02:40 AM
You may search and remove items from the Criteria list by it's index. Iterate through all items of CriteriaList and examine the ExpressionString property of each item to find the expression.
Sergey Smagin | email
2 hours, 5 mins since original post
This topic is closed