Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

Unusual DataRow error

Mar 25 2003 4:51 AM
I use: ... myDataTable.EndLoadData(); myDataTable.AcceptChanges(); foreach(DataRow dr in myDataTable.Rows) { string buf=dr["pole"].ToString()+"Jinks"; // works OK dr["pole"]=buf; // IndexOutOfRangeException "There is no row at position ..." int np= myDataTable.Columns["pole"].Ordinal; // works OK dr.ItemArray[np]=buf; // doesn't write to row, row status=Unchanged } Error is not in every field and in every row. Thesame is if buf is a number(double, decimal). May be someone know how to fight with it? Help, please.

Answers (9)