DataSet to DataSet

  • Thread starter Thread starter Joseph D. DeJohn
  • Start date 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);

}
 
Back
Top