PC Review


Reply
Thread Tools Rate Thread

Data Services functions startswith, endswith, substringof parm ord

 
 
FredM
Guest
Posts: n/a
 
      10th Nov 2008
Would somebody at Microsoft care to explain why, when constructing a URI for
use by ADO.Net Data Services, I have to use this type of syntax with
startswith() and endswith():

sbrUri.AppendFormat("$filter=endswith(ProductName,'{0}')&", productName);
sbrUri.AppendFormat("$filter=startswith(ProductName,'{0}')&", productName);

while substringof() uses a bass akwards (IMO) syntax of:

sbrUri.AppendFormat("$filter=substringof('{0}',ProductName)&", productName);

It makes it difficult to implement even a rudimentary wild-card search
capability when you throw us curves like the one above in which the argument
order is reversed from what is used by startswith() and endswith().

Not the end of the world, but it wasted several minutes of my time trying to
figure it out.

In my simple example, I was hoping to quickly implment the ability to search
for:
1. All products that begin with a given value, such as Ch*.
2. All products that end with a given value, such as *e.
3. All products that contain a given value, such as *ha*.

The first two were easy, but the last one drove me nuts because of the
strange syntax of the substringof() filter function.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
string startswith or endswith a double quote? zacks@construction-imaging.com Microsoft C# .NET 4 15th Sep 2007 11:02 PM
ConditionalFormat-EndsWith, and logical Test IF =?Utf-8?B?dWZvX3BpbG90?= Microsoft Excel Misc 1 7th Apr 2006 03:38 PM
Query working with on parm but not another parm =?Utf-8?B?amJydWVu?= Microsoft Access Queries 0 2nd Feb 2006 08:33 PM
Problems with String's StartsWith and EndsWith in VS.NET 2003 LongBow Microsoft C# .NET 6 8th Sep 2005 07:23 PM
Re: ldifde query search a string endswith mb-2839@web.de Microsoft Windows 2000 CMD Promt 0 1st Jun 2005 11:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:23 AM.