Hi,
No really, if you are iterating a collection you cannot change it, or you
may get an exception.
IIRC I had a similar problem but with removing instead of adding, solution:
Use an ArrayList to keep the rows that you will add
after the loop add all the rows from the ArrayList into the datatable.
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Lowell Heddings" <lo****@mindjunction.com> wrote in message
news:Oc**************@TK2MSFTNGP14.phx.gbl...
Kelvin wrote: Dear All,
Please help.
Same as subject !!!
Inserting a new row is the same whether you are looping or not.
DataTable dt = new DataTable();
DataRow row = dt.NewRow();
row["columnname"] = "whatever";
dt.Rows.Add(row);
dt.AcceptChanges();
If you are looking for something more specific to your situation, then you
need to post some code.
Lowell