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 8685131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:29:11+00:00 2026-06-12T22:29:11+00:00

Following an example for Amazon Web Service API from here I got the DataSet

  • 0

Following an example for Amazon Web Service API from here I got the DataSet populated with an XML ResponseStream like so:

DS.ReadXml(responseStream);

It is then passed via DataBind to a GridView like so:

GridView1.DataSource = DS.Tables["ItemAttributes"];
GridView1.DataBind();
GridView2.DataSource = DS.Tables["Item"];
GridView2.DataBind();

The problem is, that I get all columns from that XML, and in two tables, and I want to show only certain columns (DetailPageURL, Author, Title) from XML attributes in one table. I tried things in resembling posts, but none worked. I tried also to pass the stream to XDocument before putting it on a GridView, but I get a “Root element is missing” error. Also, tried to extract those columns with Linq, wich did not work. My knowledge is limited, though, so I could be doing something wrong with the code.

The snippet for XML response that goes in the DataSet is:

<ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2011-08-01">
<OperationRequest>
<HTTPHeaders>
<Header Name="UserAgent" Value="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4"/>
</HTTPHeaders>
<RequestId>fafe85b6-3002-49ec-b716-e2057f9b94a0</RequestId>
<Arguments>
<Argument Name="Operation" Value="ItemSearch"/>
<Argument Name="Service" Value="AWSECommerceService"/>
<Argument Name="Signature" Value="..."/>
<Argument Name="AssociateTag" Value="..."/>
<Argument Name="Version" Value="2011-08-01"/>
<Argument Name="Keywords" Value="harry potter"/>
<Argument Name="AWSAccessKeyId" Value="..."/>
<Argument Name="Timestamp" Value="2012-10-14T15:16:02.000Z"/>
<Argument Name="SearchIndex" Value="Books"/>
</Arguments>
<RequestProcessingTime>0.0701880000000000</RequestProcessingTime>
</OperationRequest>
<Items>
<Request>...</Request>
<TotalResults>8394</TotalResults>
<TotalPages>840</TotalPages>
<MoreSearchResultsUrl>...</MoreSearchResultsUrl>
<Item>
<ASIN>059035342X</ASIN>
<DetailPageURL>...</DetailPageURL>
<ItemLinks>...</ItemLinks>
<ItemAttributes>
<Author>J.K. Rowling</Author>
<Creator Role="Illustrator">Mary GrandPré</Creator>
<Manufacturer>Scholastic Paperbacks</Manufacturer>
<ProductGroup>Book</ProductGroup>
<Title>Harry Potter and the Sorcerer's Stone (Book 1)</Title>
</ItemAttributes>
  • 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-12T22:29:12+00:00Added an answer on June 12, 2026 at 10:29 pm

    To answer my own question, I declared two new DataTables and in them put the desired columns, like so:

    var dataTable1 = DS.Tables["Item"];
    var dataTable2 = DS.Tables["ItemAttributes"];
    
    if (dataTable1.Rows.Count > 0)
    {
        foreach (DataRow row in dataTable1.Rows)
        {
            var url = row["DetailPageURL"].ToString();
        }
    }
    
    if (dataTable2.Rows.Count > 0)
    {
        foreach (DataRow row in dataTable2.Rows)
        {
            var title = row["Title"].ToString();
            var author = row["Manufacturer"].ToString();
        }
    }
    

    All I need now is find a way to put the two tables together in one, since this is showing errors:

    dataTable1.Merge(dataTable2);
    DataTable merged = dataTable1;
    GridView1.DataSource = merged;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am following the official Amazon S3 REST API documentation here and am having
I'm using the amazon-product-advertising-api gem and am following the example code to try and
I have tree like following example, where every leaf is object. [1] |--[2] |
like exposed here , one can set a MEDIA_URL in settings.py (for example i'm
I am reading the price information from the http://aws.amazon.com/ec2/pricing/pricing-ebs-optimized-instances.json following is the code example
I've got an Amazon elastic IP. I've a subdomain like aap.myhosting.com and I wanna
The following example is from Wikipedia . int arr[4] = {0, 1, 2, 3};
The following example is from Google to create a ColumnChart using Google Charts function
The following example is taken from C# in Depth: What you need to master
Following example - the YoutubePlayer API videoID.addEventListener('onStateChange', 'foo'); In the documentation they say, video.addEventListener(string:

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.