Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6122095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:51:33+00:00 2026-05-23T15:51:33+00:00

Good day, I am going to try be as breif but informative as possible,

  • 0

Good day, I am going to try be as breif but informative as possible, I am using asp.net 3.5 and C#, basically what I am attempting to do is collect information from a xml file I recieve from a HTTPRequest. However using the usual dataset.readxml is not working for me. Please take a minute to look through everything before posting any answers.

I recieve xml that looks like this: (I have removed some information but am happy to supply the full XML set that I recieve as I am trying not to spam this with rubbish info)

    <SEGMENTS>
<SEGMENT NAME="webcluster">
    <RESULTPAGE>
        <QUERYTRANSFORMS>
            <QUERYTRANSFORM NAME="Original query" ACTION="NOP" QUERY="printers" CUSTOM="" MESSAGE="Original query" MESSAGEID="1"/>
            <QUERYTRANSFORM NAME="FastQT_Lemmatizer" ACTION="nop" QUERY="" CUSTOM="No change to query" MESSAGE="Lemmatization turned off for current query" MESSAGEID="16" INSTANCE="lemmatizer"/>
            <QUERYTRANSFORM NAME="Final query" ACTION="NOP" QUERY="string("printers")" CUSTOM="FQL" MESSAGE="Final query" MESSAGEID="1"/>
        </QUERYTRANSFORMS>
        <NAVIGATION ENTRIES="0">
        </NAVIGATION>
        <CLUSTERS/>
        <RESULTSET FIRSTHIT="1" LASTHIT="1" HITS="1" TOTALHITS="1121" MAXRANK="6610" TIME="0.0000">
            <HIT NO="1" RANK="6610" SITEID="0" MOREHITS="0" FCOCOUNT="0">
                <FIELD NAME="body"/>
                <FIELD NAME="customerid">36547986</FIELD>
                <FIELD NAME="name">Yahunn Digital <key>Printers</key></FIELD>
                <FIELD NAME="itemcode">DTRJ</FIELD>
                <FIELD NAME="bookcode">155512</FIELD>
                <FIELD NAME="heading">BANNERS</FIELD>
                <FIELD NAME="link2">15530694.GIF</FIELD>
            </HIT>
        </RESULTSET>
        <PAGENAVIGATION>
            <NEXTPAGE FIRSTHIT="2" LASTHIT="2" URL="/cgi-bin/xml-search?query=printers&hits=1&offset=1"/>
        </PAGENAVIGATION>
    </RESULTPAGE>
</SEGMENT>

I attempt to read it using the following:

    HttpWebRequest request = WebRequest.Create(builder.Uri) as HttpWebRequest;
        using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
        {
            // Get the response stream  
            StreamReader readerSR = new StreamReader(response.GetResponseStream());

            // Console application output  
            //lblReturn.Text = readerSR.ReadToEnd().ToString();
            DataSet XMLDataSet = new DataSet();
            XMLDataSet.ReadXml(readerSR);
            dgvResults.DataSource = XMLDataSet.Tables[9].DefaultView;
            dgvResults.DataBind();
        }; 

But the simple answer is that this does not return a proper set of information to populate the gridview with. The table XMLDataSet.Tables[7].Rows.Count.ToString() contains 223 rows, which is completely incorrect, with the xml I gave that is 1 result(ofcourse I left out 216 “fields” which are returned for the example) but it seems it is creating a row for each “FIELD”. My question is, how would I either get the information into a DataGridView, or should I be doing something enirely different to display this information? The reason I would like to use a gridview is purely because I am confrtable with the customization of a gridview.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:51:33+00:00Added an answer on May 23, 2026 at 3:51 pm

    You have a wrong XML schema so you cant read the XML file
    so the problem that you cant load the XML.
    please try to fix xml schema befor render to grid view

    QUERY=”string(“printers”)” => QUERY=”string(‘printers’)”

    Note that the ‘&’ destroy the XML and cause a render error so i used to replace it by %26%.

    and the close tag for the root tag [SEGMENTS]

    hope this will help you

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day, I try to start new Activity from another. But it always crashed.
I will try to explain the issue as good as possible. What I want
Good day sirs, because it looks like mine isn't going to be that good.
Good day. I have a class that I’m going to use to generate math
Good day. I'm developing a website with the database which is going to be
Good day, I've done some research looking for this answer, but haven't had much
I am going though the Apress ASP.NET MVC 3 book and trying to ensure
Good Day, I just started to learn HTML5 - have no issues, everything's going
Good day! Is it possible to create mobile games or services just knowing Java
Good day, I have been using JNA for a while to interact with the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.