Add a row from DataTable to second DatTable

5 pts.
Tags:
Data Tables
Hello, I have a DataTable that gets new data in loop, each time the data is changed I want to enter the new row to second DataTable (that in the end of the loop will contain the whole data). Here is my code and my problem is in the end: //ReminderDetail - the DataTable that is changed in loop //RemindersForNow - the DataTable that should get the new row from ReminderDetail ReminderDetail = Program.aHelper.LoadRemindersOfHousesForRentPerREMINDERID(Convert.ToInt16(ArrayRemindersForNow.Rows[i]["ReminderID">)); //Add the HouseForTable if (ReminderDetail.Rows.Count > 0) { RemindersForNow = ReminderDetail.Clone(); foreach (DataRow dr in ReminderDetail.Rows) { RemindersForNow.ImportRow(dr); } } My problem is: if I wrote the row of: RemindersForNow = ReminderDetail.Clone(); in the main loop of the ReminderDetail loop - the second DataTable become RemindersForNow .Rows.Count = 0; but if I don't write that line, the loop works fine and i see that the rows enter to RemindersForNow DataTable; RemindersForNow .Rows.Count = 1 and after that 2 etc. but RemindersForNow .Columns.Count = 0!!!!! instead of 75 columns. Can you help me?
ASKED: June 10, 2009  5:05 PM
UPDATED: June 10, 2009  5:28 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following