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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:25:09+00:00 2026-05-27T00:25:09+00:00

I have a c# question : I have 2 datatable A and B both

  • 0

I have a c# question :
I have 2 datatable A and B both of them contain a column called “move” , I want to create another Datable with 2 columns one with “move” from A the other with “move” from B , I tried something like this :

//cherche les last price
DataTable TickerPrice = new DataTable("Data");
TickerPrice = CheckBloomi(TickerName + " equity", "CHG_PCT_1D", FromThisTime, ToThisTime);

//cherche les last price
DataTable IndexPrice = new DataTable("Data");
IndexPrice = CheckBloomi("E300 Index", "CHG_PCT_1D", FromThisTime, ToThisTime);

DataSet MarketData = new DataSet();

DataTable Recap = MarketData.Tables.Add("Recap");
Recap.Columns.Add("Move Ticker price");
Recap.Columns.Add("Move Index price");

foreach (DataRow sourcerow in TickerPrice.Rows)
{
    DataRow destRow = Recap.NewRow();
    destRow["Move Ticker price"] = sourcerow["CHG_PCT_1D"];
    Recap.Rows.Add(destRow);
}

foreach (DataRow sourcerow in IndexPrice.Rows)
{
    DataRow destRow = Recap.NewRow();
    destRow["Move Index price"] = sourcerow["CHG_PCT_1D"];
    Recap.Rows.Add(destRow);
}

This work fine to copy one column (for the first foreach loop) but then for the second column I have the number shifted because I am recreating new rows.

Do you an idea of how to do that ?, let me know if it is not clear enough

  • 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-27T00:25:09+00:00Added an answer on May 27, 2026 at 12:25 am

    Assuming that the both the TicketPrice and IndexPrice tables match up then you could do something like:

    for (int i = 0; i < TickerPrice.Rows.Count; i++)
    {
        DataRow destRow = Recap.NewRow();
        destRow["Move Ticker price"] = TickerPrice.Rows[i]["CHG_PCT_1D"];
        destRow["Move Index price"] = IndexPrice.Rows[i]["CHG_PCT_1D"];
    
        Recap.Rows.Add(destRow);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with VB.NET.. i have a DataTable called QUESTION, containing 3 fields:
I have 3 columns in a DataTable Id Name Count 1 James 4345 2
I have a question regarding Wicket's Datatable. I am currently using DataTable to display
I have an architect question: I want to use Tree View to display some
Update: Here's a similar question Suppose I have a DataTable with a few thousand
I have a data tier select method that returns a datatable. It's called from
I have One question In My Grid get info from 6 sql server table.
I have seen this question on how to display a DataTable in a view
I have a DataTable, say pdt, in my code. I just want to select
From this previously asked question , I have noticed that when I move a

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.