Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > DataSet to DataSet

Reply
Thread Tools

DataSet to DataSet

 
 
Joseph D. DeJohn
Guest
Posts: n/a
 
      08-04-2003
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[i].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/


 
Reply With Quote
 
 
 
 
Rory
Guest
Posts: n/a
 
      08-04-2003
what about..

m_dsAccounts.Tables[0].Rows[i][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[i].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/
>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataSet and dataSet JimO ASP .Net 2 03-08-2006 02:39 PM
Converting a generic Dataset to a typed dataset William Gower ASP .Net 2 07-26-2004 10:14 PM
copying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N ASP .Net 2 10-31-2003 01:05 PM
Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N ASP .Net 1 10-31-2003 02:39 AM



Advertisments