.net - C# DataTable delete row -


i have datatable participantaccounts not connected database or something.

how can delete row it?

this not working :

for (int = participantaccounts.rows.count - 1; >= 0; i--) {           datarow dr= participantaccounts.rows[i];           if (equals(dr["sellrmembid"].tostring(), itemid))             participantaccounts.rows.removeat(i);         }          participantaccounts.acceptchanges(); 

it acts fine row still remains in datatable. tried dr.delete() neither works. when try participantaccounts.rows.remove(dr) exception the given datarow not in current datarowcollection.

what doing wrong?

if (participantaccounts.rows.contains(itemid))             {                 datarow foundrow = participantaccounts.rows.find(itemid);                 participantaccounts.rows.remove(foundrow);             } 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -