c# - how to edit column value before binding to gridview after retriving from database? -
after retrieved set of datatable database, need edit rows value before binding gridview. example, set of datatable retrived database.
eg: [userid], [useremail] --> 1 , james@hotmail.com
i change "james@hotmail.com" "james" bind gridview. every rows of [useremail] separated mail extension (@hotmail.com) ... how should do..?
something should work:
datatable dt = getmydatatable(); foreach (datarow dr in dt.rows) { string email = convert.tostring(dr["email"]); email = email.substring(0, email.indexof('@')); dr["email"] = email; }
Comments
Post a Comment