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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:23:57+00:00 2026-05-26T06:23:57+00:00

I have an ASP.NET data repeater. This is currently set to a data source

  • 0

I have an ASP.NET data repeater. This is currently set to a data source obtained from an SQL query, as follows:

IDataReader dr = GetData(sql);
myRepeater.DataSource = dr;
myRepeater.DataBind();

This works fine, but what I want to do now is to call a web service, passing all the data returned from the SQL query and make that available to the repeater as well. So, my question is, can I manipulate the data reader object before it is bound, or the data repeater afterwards in order to achieve this; for example:

IDataReader dr = GetData(sql);

var extraData = CallWS(dr);    
foreach (MyData d in extraData)
{
    dr.AddField(d.Value);
}

myRepeater.DataSource = dr;
myRepeater.DataBind();
  • 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-26T06:23:58+00:00Added an answer on May 26, 2026 at 6:23 am

    There are many ways that you can do this. Probably the easiest way is to put the values from the first query into a Collection by looping around the DataReader and then adding them into the collection. Then call the web service and append those results to the collection also. Then you will have a collection containing all of your results that you can bind to the repeater.

            IDataReader dr = GetData(sql);
            var dataCollection = new List<string>();
    
            while(reader.Read())
            {
                dataCollection.Add(reader.GetString(1));
            }
    
            var extraData = CallWS();
    
            while(extraData.Read())
            {
                dataCollection.Add(extraData.GetString(1));
            }
    
            myRepeater.DataSource = dataCollection;
            myRepeater.DataBind();
    

    Something like the above. That’s not that much extra code. I know you’re not passing the results into the web service but I would advise against that for a number of reasons:

    1) Extra data transfer. There is no point passing the results to the web service for the web service to just pass them back again (unless they are needed as part of the query).
    2) If the web service cant function without a set of results from another query then the web service isnt very well encapsulated and one could argue the external query really belongs inside the web service if it’s integral to it functioning.

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

Sidebar

Related Questions

I have a repeater that's bound to a SQL Data Source (using ASP.NET). Are
I have an ASP.NET web form that uses an ASP.NET Repeater. The data source
I have a repeater which binds a set of data. Within this repeater is
I have an ASP.NET control that binds data to a repeater. Inside that repeater,
I have an ASP.Net Repeater I want to use to show From and Text
I'm using repeater control from asp.net for data binding. And for designing i used
I have an ASP.NET Dynamic Data application (using Entity Framework) in which I have
I have an ASP.NET page A that uses a data layer assembly DAL .
I have an ASP.NET MVC project with xVal and data annotations and I need
I have a ASP.Net TreeView control that I am binding to an XML data

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.