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

  • Home
  • SEARCH
  • 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 8528999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:55:45+00:00 2026-06-11T08:55:45+00:00

I have an ASP site with a dataset and gridview, which I want to

  • 0

I have an ASP site with a dataset and gridview, which I want to display XML data.

The gridview is not automatically generated, and is set to find hotelid, name, status, city & country.

Currently, I have written the XML manually, however I have included wrapper tags and additional error tags that will be required in this XML but whenever they are included, an error shows up saying the gridview was unable to find “HOTEL_ID” property. It works fine without the additional data.

XML example:

<REQUEST><ACTION>HOTEL_LIST</ACTION><RESPONSE><RESULT>0</RESULT>
<HOTELS>
<HOTEL><HOTELID>hot01</HOTELID><NAME>hotel test 1</NAME><CITY>birmingham</CITY><COUNTRY>england</COUNTRY><STATUS>active</STATUS></HOTEL>
<HOTEL><HOTELID>hot02</HOTELID><NAME>hotelabctestabc2abc</NAME><CITY>barca</CITY><COUNTRY>spain</COUNTRY><STATUS>inactive</STATUS></HOTEL>
<HOTEL><HOTELID>hot03</HOTELID><NAME>hotelabctestabcire</NAME><CITY>dublin</CITY><COUNTRY>ireland</COUNTRY><STATUS>active</STATUS></HOTEL>    
</HOTELS>
<ERRORS><ERROR><CODE></CODE><MESSAGE></MESSAGE></ERROR></ERRORS></RESPONSE></REQUEST>`

and Here is the VB Code:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles   Me.Load

    Dim teststring As String = "THE XML SHOWN ABOVE"

    Dim ds As New DataSet()
    Dim doc As New XmlDocument()

    doc.LoadXml(teststring)
    ds.ReadXml(New System.IO.StringReader(doc.OuterXml))

    GridView1.DataSource = ds
    GridView1.DataBind()


End Sub

`

If I remove leave only the only hotel info, it works and finds the property;

<HOTELS><HOTEL><HOTELID>hot01</HOTELID><NAME>hotel test 1</NAME><CITY>birmingham</CITY><COUNTRY>england</COUNTRY><STATUS>active</STATUS></HOTEL>

<HOTEL><HOTELID>hot02</HOTELID><NAME>hotelabctestabc2abc</NAME><CITY>barca</CITY><COUNTRY>spain</COUNTRY><STATUS>inactive</STATUS></HOTEL><HOTEL>

<HOTELID>hot03</HOTELID><NAME>hotelabctestabcire</NAME><CITY>dublin</CITY><COUNTRY>ireland</COUNTRY><STATUS>active</STATUS></HOTEL></HOTELS>

What am I doing wrong?

Thanks.

  • 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-06-11T08:55:46+00:00Added an answer on June 11, 2026 at 8:55 am

    When you are loading an XML document like that into a DataSet, it creates multiple tables based on the data.

    In order to bind only the Hotel info to your GridView, you will need to identify which table in the dataset contains the data and then bind this to the GridView

    e.g.

    GridView1.DataSource = ds.Tables(index_of_table_which_contains_data)
    

    Hope that helps.

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

Sidebar

Related Questions

I have an ASP.NET web site set up to use windows authentication (not sure
I have an ASP.Net site, in which I am using a ListView with a
simple question... Given I have an ASP.NET site, which uses a [custom] RoleProvider, Is
I have an Asp.Net site which uses google SMTP to send emails.. its working
I have this asp.NET web site that for some odd reason doesn't want to
I have asp.net web site in which user can login and also do logout
I have ASP.net web site which compiled in .net 3.5 and looking for aspnet_regsql
I have an asp.net site which was developed with Visual Studio Pro 2010 with
I have my ASP.NET site generated from Web Forms template in Visual Studio 2012.
I have an ASP.NET site using LINQ to SQL set up with multiple databases

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.