datatable to dataset..

Discussion in '.NET' started by PaceMachine, Jul 27, 2010.

  1. PaceMachine

    PaceMachine

    Joined:
    Jul 25, 2010
    Messages:
    1
    Dear all,

    I have a problem with updating a table exisitng in the dataset from a datatable. i have created a table (say, t1) dynamically with the columns of a table existing in the database (say t2). i am populating the rows of the table t1. Now, I want to add the rows of t1 to t2. Please help me...
     
    PaceMachine, Jul 27, 2010
    #1
    1. Advertising

  2. PaceMachine

    sachin_arora2020

    Joined:
    Sep 4, 2010
    Messages:
    1
    Location:
    New Delhi,India
    Try This,
    Pick up a row from table t1, say row dr.
    create a new row dr2 = t2.Newrow();

    //now copy all elements of row dr to dr2
    //by using dr.ItemArray property:
    dr2.ItemArray=dr.ItemArray

    //and add the row dr2 to t2.
    t2.Rows.Add(dr2);
     
    Last edited: Sep 4, 2010
    sachin_arora2020, Sep 4, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nedu N
    Replies:
    1
    Views:
    1,809
    Chris Taylor
    Oct 31, 2003
  2. J. Babe
    Replies:
    1
    Views:
    8,364
    Kevin Spencer
    Aug 15, 2003
  3. Nedu N
    Replies:
    2
    Views:
    2,167
  4. Fredrik Rodin

    Sort a datatable and create a new datatable

    Fredrik Rodin, Feb 16, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    9,062
    paul.mariotti
    Sep 28, 2007
  5. Nedu N
    Replies:
    2
    Views:
    224
    Jacob Yang [MSFT]
    Oct 31, 2003
Loading...

Share This Page