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

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -