DataSet to DataSet

  • Thread starter Joseph D. DeJohn
  • Start date
J

Joseph D. DeJohn

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);

}
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,829
Latest member
PIXThurman

Latest Threads

Top