Unusual DataRow error
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.
AdministratorRank #675 · 3.6K reputationPosted Mar 27, 2003, 7:48 PM EST
AdministratorRank #675 · 3.6K reputationPosted Mar 28, 2003, 1:28 AM EST
AdministratorRank #675 · 3.6K reputationPosted Mar 28, 2003, 2:31 AM EST
AdministratorRank #675 · 3.6K reputationPosted Mar 28, 2003, 2:43 AM EST
AdministratorRank #675 · 3.6K reputationPosted Mar 30, 2003, 6:21 PM EST
AdministratorRank #675 · 3.6K reputationPosted Mar 30, 2003, 8:41 PM EST
Andrzej WegierskiRank #1,729 · 877 reputationPosted Sep 17, 2003, 10:00 AM EDT
pgpno4 reputationPosted Sep 22, 2003, 5:11 AM EDT
thed0ct0r84 reputationPosted Oct 14, 2003, 2:30 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts