datatable to dataset..

Joined
Jul 25, 2010
Messages
1
Reaction score
0
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...
 
Joined
Sep 4, 2010
Messages
1
Reaction score
0
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:

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top