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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:43:01+00:00 2026-05-15T18:43:01+00:00

Let’s say I have two DataTables DT1 and DT2 with a single row. DT1

  • 0

Let’s say I have two DataTables DT1 and DT2 with a single row.

DT1 has 3 columns: Col1, Col2, and Col3

and

DT2 has 2 columns: ColA, ColB.

Is it possible to join these two DataTables horizontally so I get Col1, Col2, Col3, ColA, and ColB?

  • 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-15T18:43:02+00:00Added an answer on May 15, 2026 at 6:43 pm

    I thin you have to add new columns and copy data either in third table or in one of the existing table

        DataTable dt1 = new DataTable();
    
        dt1.Columns.Add("col1", typeof(string));
        dt1.Columns.Add("col2", typeof(string));
        dt1.Columns.Add("col3", typeof(string));
    
        DataTable dt2 = new DataTable();
    
        dt2.Columns.Add("cola", typeof(string));
        dt2.Columns.Add("colb", typeof(string));
    
        object[] row = {'1', '2', '3'};
        dt1.Rows.Add(row);
    
        object[] row1 = { 'a', 'b' };
        dt2.Rows.Add(row1);
    
        // Create columns in dt1
        dt1.Columns.Add("cola", typeof(string));
        dt1.Columns.Add("colb", typeof(string));
    
        // Copy data from dt2
        dt1.Rows[0]["cola"] = dt2.Rows[0]["cola"];
        dt1.Rows[0]["colb"] = dt2.Rows[0]["colb"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have the following text: (example) <table> <tr> <td> <span>col1</span> </td> <td>col2</td>
Let's say I have two assemblies: BusinessLogic and Web. BusinessLogic has an application setting
Let's say we have a table that has 2 million rows. It has two
Let's say I have two tables orgs and states orgs is (o_ID, state_abbr) and
Let say I have two UIViews: View1: - bounds: 0, 0, 20, 20 -
Let's say that you have a stick figure. Let's say the stick figure has
Let's say I don't have photoshop, but I want to make pattern files (.pat)
Let's say I have a method in java, which looks up a user in
Let me explain best with an example. Say you have node class that can
Let's say I have a table with a Color column. Color can have various

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.