Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ole db where error
Message
From
25/01/2005 04:38:06
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00980292
Message ID:
00980303
Views:
50
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform