DataSet to DataSet

Discussion in 'ASP .Net' started by Joseph D. DeJohn, Aug 4, 2003.

  1. Hello,
    I'm trying to copy data from one DataSet to another DataSet. My
    question is, how do you access a column in a specific row. Similar to an
    array. Can you do that? I'm sure there is something basic I'm just not
    understanding.

    // Now fill temporary DataSet to be the DataSource.

    for(int i = firstNumberOfRecord; i <= lastNumberOfRecord; i++)

    {

    // Declare a Row object.

    DataRow newRow = m_dsAccountsCustom.Tables[0].NewRow();


    // Transfer values into the new columns.

    newRow[0] = m_dsAccounts.Tables[0].Column[0];

    newRow[1] = m_dsAccounts.Tables[0].Column[1];

    newRow[2] = m_dsAccounts.Tables[0].Column[2];

    newRow[3] = m_dsAccounts.Tables[0].Rows;

    newRow[4] = m_dsAccounts.Tables[0].Rows.Column[4];

    // Add the new row to the temporary DataSet.

    m_dsAccountsCustom.Tables[0].Rows.Add(newRow);

    }


    --
    Sincerely,
    Joseph D. DeJohn
    http://www.geocities.com/cujdd5/
    Joseph D. DeJohn, Aug 4, 2003
    #1
    1. Advertising

  2. Joseph D. DeJohn

    Rory Guest

    what about..

    m_dsAccounts.Tables[0].Rows[4];


    >-----Original Message-----
    >Hello,
    > I'm trying to copy data from one DataSet to

    another DataSet. My
    >question is, how do you access a column in a specific

    row. Similar to an
    >array. Can you do that? I'm sure there is something

    basic I'm just not
    >understanding.
    >
    >// Now fill temporary DataSet to be the DataSource.
    >
    >for(int i = firstNumberOfRecord; i <= lastNumberOfRecord;

    i++)
    >
    >{
    >
    >// Declare a Row object.
    >
    >DataRow newRow = m_dsAccountsCustom.Tables[0].NewRow();
    >
    >
    >// Transfer values into the new columns.
    >
    >newRow[0] = m_dsAccounts.Tables[0].Column[0];
    >
    >newRow[1] = m_dsAccounts.Tables[0].Column[1];
    >
    >newRow[2] = m_dsAccounts.Tables[0].Column[2];
    >
    >newRow[3] = m_dsAccounts.Tables[0].Rows;
    >
    >newRow[4] = m_dsAccounts.Tables[0].Rows.Column[4];
    >
    >// Add the new row to the temporary DataSet.
    >
    >m_dsAccountsCustom.Tables[0].Rows.Add(newRow);
    >
    >}
    >
    >
    >--
    >Sincerely,
    >Joseph D. DeJohn
    >http://www.geocities.com/cujdd5/
    >
    >
    >.
    >
    Rory, Aug 4, 2003
    #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,777
    Chris Taylor
    Oct 31, 2003
  2. JimO

    DataSet and dataSet

    JimO, Mar 1, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    509
    Mary Chipman [MSFT]
    Mar 8, 2006
  3. Nedu N
    Replies:
    2
    Views:
    2,143
  4. William Gower
    Replies:
    2
    Views:
    4,113
    Brian Baker [MVP]
    Jul 26, 2004
  5. thomson
    Replies:
    2
    Views:
    14,819
    Eliyahu Goldin
    Jan 19, 2005
Loading...

Share This Page