>Hi.
>I am getting an oledb exception error in a elect where clause
>
>string cStr;
>cStr = cString.ToLower().Trim();
>this.sSelectString = "SELECT " + this.sFields + " FROM " + this.sTableName +
> " WHERE cStr IN isr_name ";
>
>Im sure the problem is in the 'Where' syntax command as it selects all records
> into the dataset ok if I take the Where Bit Out.
>
>What I would really like to do is something like:
>
>where Upper(Alltrim(Mystring)) in Upper(Field1) or Upper(Field2) or Upper(Field3)
>
>Any help appreciated.
>regards
>
>Gerard
Gerard,
I couldn't get how that IN translates to that or, anyway if your fields to compare are few as you showed then:
cStr = cString.ToUpper().Trim();
this.sSelectString = String.Format(@"SELECT {0} FROM {1}
WHERE upper(Field1+Field2+Field3) like '%{2}%'",
this.sFields,this.sTableName,cStr);
Cetin