QueryEx web services issue

George2
  • QueryEx web services issue George2

    I am using Microsoft Search Server 2008 (based on SharePoint Server 2007) + C# + .Net 3.5 + VSTS 2008 + ASP.Net to develop a web application which invokes Search Server 2008 Web Services when a button in the html page is pressed.

    I am using the following code to query content from Microsoft Search Server 2008. My question is how to display the search results from the DataSet retrieved? I did not find a very good sample from Google.

        protected void Button1_Click(object sender, EventArgs e)
        {
            //The string containing the keyword to use in the search
            string keywordString = "Microsoft";
    
            //The XML string containing the query request information 
            //for the Web service
            string qXMLString = "<QueryPacket xmlns='urn:Microsoft.Search.Query'>" +
            "<Query><SupportedFormats><Format revision='1'>" +
            "urn:Microsoft.Search.Response.Document:Document</Format>" +
            "</SupportedFormats><Context><QueryText language='en-US' type='STRING'>" +
            keywordString + "</QueryText></Context></Query></QueryPacket>";
    
            SearchTest.QueryService queryService = new SearchTest.QueryService();
            queryService.Credentials = System.Net.CredentialCache.DefaultCredentials;
            DataSet ds = queryService.QueryEx(qXMLString);
        }
    

    thanks in advance!

  • Why don't you just add a DataGridView to your app and then bind to the DataSet like this:

    dataGridView.AutoResizeColumns( DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader);
    dataGridView.DataSource = ds.Tables[0];
    

Tags
2007 search web-services
Related questions and answers
  • using ListViewByQuery control. Here is how an SPQuery looks: &lt;Query>; &lt;Where> &lt;Eq> &lt;FieldRef Name='Relaterat_x0020_till_x0020_avtal' LookupId='TRUE' /&gt; &lt;Value Type='Lookup'&gt;1&lt;/Value> &lt;/Eq> &lt;/Where> &lt;/Query>; The problem is that this SPQuery returns results only for the first 13 lookup... and not the id) &lt;Query>; &lt;Where> &lt;Eq> &lt;FieldRef Name='Relaterat_x0020_till_x0020_avtal' /&gt; &lt;Value Type='Lookup'&gt;Test avtal</Value>

  • Hello I really need help with this... , I am using Sharepoint 2007. I have the 'collect data from user' action in a workflow - which generates a custom form within the workflow folder. The form...://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal"&gt; &lt;xsl:output method="html" indent...('ff4',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@TaskIDNum')}"/&gt; &lt;SharePoint:FieldDescription runat="server" id="ff4description{$Pos

  • , but that ends up rendering the actual anchor tag, as opposed to a clickable hyperlink: &lt;a href="http://www.something.com"&gt;www.something.com&lt;/a> So then I tried creating a XSL transform, since that is supposed to be the new and improved way of doing this. Unfortunately, I can't get that to work either. I am getting the same thing I got using the RenderPattern. I'm no XSL expert, so can anyone...="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal"&gt; &lt;xsl:template match="FieldRef[@FieldType='DataLinkUrl']" mode="Note_body"&gt; &lt;xsl:param name="thisNode" select="."/&gt; &lt;xsl

  • I have successfully created a DVWP which queries all lists in my subsites and returns the correct columns using the following selectcommand: &lt;View> &lt;Webs Scope="Recursive"&gt;&lt...; &lt;FieldRef Name="ID" /&gt; &lt;FieldRef Name="StreamName" /&gt; &lt;/ViewFields> &lt;/View> &lt;Query>; &lt;OrderBy> &lt;FieldRef Name="StreamName" Ascending="TRUE" /&gt; &lt;FieldRef Name="Title" Ascending="TRUE" /&gt; &lt;/OrderBy> &lt;/Query>; &lt;/View> One of the things i would now

  • " Nullable="TRUE" Type="UserMulti" /&gt; &lt;!-- // Field which do not return values --&gt; &lt;ProjectProperty Name="Title" /&gt; &lt;/ViewFields> &lt;/View> &lt;Query>; &lt;OrderBy> &lt;ProjectProperty Name="Title" Ascending="TRUE" /&gt; &lt;FieldRef Name="Title" Ascending="TRUE" /&gt; &lt;/OrderBy> &lt;/Query>; &lt;/View> I'm trying...I have created a recursive query that contains 2 multi user fields. After much thrashing, where I would add the and had my query return no results, I found that the FieldRef needed to include

  • "/&gt; &lt;xsl:value-of select="sum($Rows/@Distance[.!=''])" /&gt; &lt;/xsl:template> &lt;/xsl:stylesheet> The result is: "NaN", so I figure that my XSLT is wrong. Question...I have this (an attempt to solve the task): &lt;xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes.../WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage

  • where I'm programmatically trying to add it using the "Upload Web Part" feature. This is the code I'm using to add the web part: function addWebPart(serverRelativeUrl) { //var webPartXml = "&lt...()); } UPDATE: Based on feedback from Wictor, I tried the following: &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;webParts> &lt;webPart xmlns="http://schemas.microsoft.com/WebPart/v3"&gt; &lt...;importErrorMessage>Cannot import this Web Part.&lt;/importErrorMessage> &lt;/metaData> &lt;data> &lt;properties> &lt;property name="Title" type="string"&gt

  • ) at &lt;xsl:template match="w:tc"&gt;(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt... file DOESN'T exist. Deleting path, returning, and blocklisting error code CE_OTHER_BLOCKLIST from the document conversions framework in the callback handler then i get this monster During...I started using the document conversion feature with MOSS 2007 and Word 2007. The process seems to work fine with DOCX documents. So I tried adding quick parts metadata to the docs, and no luck. Can

  • I have created a "Hello World" web part. When I pressed F5 in Visual Studio 2010, I got the following error. I have already got Microsoft SharePoint Foundation User Code Service started. Can anyone... 85bd84a2-ded2-41b1-b825-5ae6ed403192 Search Query and Site Settings Service 9223cc15-d169-4c1b-8720-f1b0a153bd6d Web Analytics Web Service... Application Registry Service 46e7ddc8-49af-4a7e-9eee-155f526ed509 Microsoft SharePoint Foundation User Code Service

Data information