Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QueryProvider question

Status
Not open for further replies.

liorlankril

Programmer
Nov 5, 2005
46
IL
I have a Web part code (in c#) that contain this code

PortalContext context = PortalApplication.GetContext();
QueryProvider qp = new QueryProvider(context.SearchApplicationName);

string query = "SELECT "
+ "\"urn:schemas-microsoft-com:sharepoint:portal:profile:FirstName\", "
+ "\"urn:schemas-microsoft-com:sharepoint:portal:profile:LastName\" "
+ "FROM (TABLE Portal_Content..Scope() UNION ALL "
+ "TABLE Non_Portal_Content..Scope() ) "
+ " WHERE "
+ "((\"urn:schemas.microsoft.com:fulltextqueryinfo:Sourcegroup\" = 'People')) "
+ "AND NOT ((\"urn:schemas-microsoft-com:sharepoint:portal:profile:FirstName\" = '')) "
+ "AND NOT ((\"urn:schemas-microsoft-com:sharepoint:portal:profile:FirstName\" IS NULL)) "
+ "AND ((\"DAV:contentclass\" = 'urn:content-class:SPSPeople') ) "
+ "ORDER BY \"urn:schemas-microsoft-com:sharepoint:portal:profile:FirstName\"";

DataSet ds = new DataSet();
ds = qp.Execute(query);

I want to get all FirstName and LastName of all portal users profile !

But my code return me no result (0 rows in the DataSet)!!!

Whats wrong?????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top