You need to update the SO_Status in database and rebind the grid from database.
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
Int16 email;
if ( e.CommandName == "Select")
{
email = Convert.ToInt16(e.CommandArgument);
em.Text = GridView1.Rows[email].Cells[4].Text;
//send the email
if (Sendmail(em.Text))
{
updateStatus(em.Text);
// rebind the grid.
bindgrid();
}
else
{
// write code to show error message.
}
}
}
private bool Sendmail( string email)
{
// code to send mail
// you can find the code on google.
return returnvalue;
}
private void updateStatus(string email)
{
// Code to update db colomn
}
private void bindgrid()
{
// code to bind grid.
}