Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0
how to save data from two table to two table
Posted 7-Oct-12 1:14am
Comments
Sandip.Nascar at 7-Oct-12 7:37am
   
It's not too clear, what you want to do? Please be more specific of your problem.
Zoltán Zörgő at 7-Oct-12 8:04am
   
Just like that.
What database engine? On database side, or via a client? One-to-one or some transformation is needed? Or it is a web related question, and you are dealing with some html tables? Or you want to copy Excel or Word tables...? Did you really thought, that somebody could understand those few words, that are not even a sentence?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

if You mean Table such as two Dimensional Array in C# so one of ways :
  // Table num1
            int[,] num1 = {
                              {1,2},
                              {3,4},
                              {5,6},
                              {7,8}
                          };
            // Table num2
            int[,] num2 = {
                              {9,10},
                              {11,12},
                              {13,14},
                              {15,16}
                           };
            // Table num3, num4
            int[,] num3 = new int[4, 2];
            int[,] num4 = new int[4, 2];
 
            // Save to Table num3
            for (int i = 0; i < 4; i++)
                for (int j = 0; j < 2; j++)
                
                    num3[i, j] = num1[i, j];
 
            // Save to Table num4
            for (int i = 0; i < 4; i++)
                for (int j = 0; j < 2; j++)
                    num4[i, j] = num2[i, j];
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web01 | 2.8.141015.1 | Last Updated 7 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100