I am building a phone catalog of my organization (an AJAX application which accesses the search.asmx web service).
I'd like to show a list box where the user could select a department (which is stored in managed property Department
). To fill the list box with values, I need to somehow select all the distinct values of that property.
Is it possible through search.asmx web service?
What I've found:
- an article, which states that it is possible, but it does not use the web service interface
- a Microsoft's white paper which states that "If the protocol client specifies at least one property, it MUST also s开发者_Python百科pecify the Path property. If it does not, the protocol server MUST return the status code "ERROR_BAD_QUERY"."
The two findings are somewhat inconsistent. (and, yes the search really returns ERROR_BAD_QUERY).
Why bother to check with the web service or complicate it?
- Get all the properties into a DataTable.
- Then create a DataView & then you can apply the DISTINCT on required column.
- Finally use it to bind to your list box.
精彩评论