Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c# looping through datatable, changing data

i need to loop through one of the columns of my datatable and do some string manipulation to it. can someone please give me an example of how i would loop through the table and update some data?

like image 837
Alex Gordon Avatar asked Nov 05 '10 17:11

Alex Gordon


1 Answers

foreach (DataRow row in MyDataTable.Rows)
{
 row["columnNameHere" Or index] = value;
}
like image 128
mint Avatar answered Oct 04 '22 13:10

mint