QueryProvider Problem in MOSS

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have web part in Sharepoint Portal server 2003, (I wrote the code in VS
2003).



I try put this web part on MOSS portal but I get error about my QueryProvider.

What should I do In order it will be work? which changes should I do in the
code?

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

SQL_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 "+

"(CONTAINS(\"urn:schemas-microsoft-com:sharepoint:portal:profile:FirstName\",
'\""+val+"*\"')" +
"OR
CONTAINS(\"urn:schemas-microsoft-com:sharepoint:portal:profile:LastName\",
'\""+val+"*\"')) ";

qp.SetProperty("Maximum Rows",_usersProfileAccounts.ToString());
ds = qp.Execute(SQL_QUERY);




The error that i get is on the property

"\"urn:schemas-microsoft-com:sharepoint:portal:profile:FirstName\", " +
"\"urn:schemas-microsoft-com:sharepoint:portal:profile:LastName\" " +


The error say that "this property was not found or not fixed to the Schem"

.



Relevant Pages

  • RE: Error using QueryProvider!
    ... Have you tried not setting your portalcontext to the site using the ... I am trying to use the SharePoint OM QueryProvider Class for fetching ... TopologyManager topology = new TopologyManager; ... PortalContext context = PortalApplication.GetContext; ...
    (microsoft.public.sharepoint.portalserver.development)
  • QueryProvider constructor causes NullReferenceException
    ... on different SPS installations, ... PortalContext context = PortalApplication.GetContext(new ... Object reference not set to ... Custom Employee Search in SPS2003 using QueryProvider ...
    (microsoft.public.sharepoint.portalserver.development)
  • RE: Error using QueryProvider!
    ... Iam using my actual server name. ... PortalContext context = PortalApplication.GetContext; ... Have you tried not setting your portalcontext to the site using the ... I am trying to use the SharePoint OM QueryProvider Class for fetching ...
    (microsoft.public.sharepoint.portalserver.development)
  • RE: Error using QueryProvider!
    ... is The portal site you're trying to connect to known in the configuration ... PortalContext context = PortalApplication.GetContext; ... Have you tried not setting your portalcontext to the site using the ... I am trying to use the SharePoint OM QueryProvider Class for fetching ...
    (microsoft.public.sharepoint.portalserver.development)