>>My question is - how can I access this _fieldID in my code?
>>I need to check _fieldID for some specific string, what would be my syntax?
>
>As I can see in source code _fieldID is private field used by public property FieldId of SqlWhereBuilderCondition class
>
>private string _fieldId = "";
>///
>/// The string identifier for the SqlWhereBuilderField used in this condition
>/// >public string FieldId
>{
> get {return _fieldId;}
> set {_fieldId = value;}
>}
>
>
>You can access this property simply
>
>mySWBuilder.Conditions[0].FieldId
>
>Maybe I misunderstand your goal?
Hi Roman,
My goal was to check if a specific condition was selected. I looped through Conditions collection and checked it with this code
if (this.SqlWhereBuilderPeople.Conditions.Count > 0)
{
for (int i=0; i < this.SqlWhereBuilderPeople.Conditions.Count; i++)
{
if (this.SqlWhereBuilderPeople.Conditions[i].FieldId.Equals("IsActive"))
{
RemoveIsActivePart = true;
}
}
qry_s = qry_s + " AND (" +
this.SqlWhereBuilderPeople.GetWhereClauseWithParameters(Command) + ") ORDER BY LastName, FirstName";
SearchCriteriaNotEmpty = true;
}
I'm wondering if this is the correct way or there is a better and simpler way.
BTW, are you using this class in your project as well?
If it's not broken, fix it until it is.
My Blog