Blog Home  Home Feed your aggregator (RSS 2.0)  
artiso Blog - DataRows in eine andere Tabelle kopieren
Neues rund um's Thema .Net
 
 Saturday, February 10, 2007

Ich falle immer wieder darauf rein, deshalb jetzt mal zum merken! Das funktioniert nicht:

foreach (DataRow dr in table1.Rows)
    table2.Rows.Add(dr);

Das führt zu einer Fehlermeldung "This row already belongs to another table.". Statt dessen muss das lauten:

foreach (DataRow dr in table1.Rows)
    table2.ImportRow(dr);

Saturday, February 10, 2007 1:55:17 PM (Mitteleuropäische Zeit, UTC+01:00)  #    Comments [0]    | 
Copyright © 2008 Thomas. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: