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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:35:39+00:00 2026-06-14T09:35:39+00:00

I have a question. I have 2 DataTables and want to copy 3 columns

  • 0

I have a question. I have 2 DataTables and want to copy 3 columns from first table to 3 columns another table. How can i do that with skip 3 first rows and then add values to 2.table?.

My code looks like that:

 foreach (DataRow ex1 in excelTb1.Rows)
            {
                foreach (DataRow ex2 in excelTb2.Rows)
                {                      

                    //ex2["ABC"] = ex1["ABC"];      // with skip(3) ?
                    //ex2["Name"] = ex1["Name"];
                    //ex2["ID"] = ex1["ID"];
                }
            }

My 1.table:___________________________My 2.table should look likt this:

          Table1                               Table2
ABC   Name   ID  ...                     ABC   Name   ID    ...                     
 a     lola   2  ...                     ...   ...    ...   ... 
 b     kiki   6  ...                     ...   ...    ...   ... 
...    ...   ... ...                     ...   ...    ...   ... 
                                         a     lola   2     ...
                                         b     kiki   6     ...        
                                         ...   ...    ...   ...             
  • 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-14T09:35:40+00:00Added an answer on June 14, 2026 at 9:35 am

    skip first 3 rows

    Use a For loop instead of foreach.

    for(int i=3; i < excelTb2.Rows.Count; i++) //start the loop with index 3 => Row 4
    {
        DataRow ex2 = exceltb2.Rows[i];
        //ex2["ABC"] = ex1["ABC"];      // with skip(3) ?
        //ex2["Name"] = ex1["Name"];
        //ex2["ID"] = ex1["ID"];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Question and QuestionTypes. In Question table there is a foreign key that
I have a question regarding primefaces datatable component. I want to bind a DataTable
I have question i.e how can i select a previous div CODE:- if($i >
I have question regarding the SQLAlchemy. How can I add into my mapped class
i have a GridView bound to a DataView. Some columns in the DataView's table
I have a question, how can i split the string and make splitted string
NOTE: This is the simple version of my previous question that SHOULD have been
I am pretty much sure that this question have been asked and answered several
I have an XML file I want to insert that in a Datatable. The
I have an architect question: I want to use Tree View to display some

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.