how can i achieve this using either c#
In your gridview, there is a method RowDataBound (ItemDataBound for Datagrids), use this method. While databind, this method would be called for every row. You can change the value of any cell as desired.
protected void myGridview_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
}
}
how can i achieve this using either SQL
While fetching the data, you must be using a query. In the query, while getting data from the column just append the necessary string to it. Like,
SELECT "A000"+ cast(agentID as nvarchar) as AgentId FROM myTable
I would suggest going with SQL way to modify it as it would be simple and easier.