first you check, what value is coming in your (GridView1.SelectedDataKey.Value)
if coming number then try to remove space with .Trim() and convert it with corresponding datatype like integer. Please try as following code.
string st=Convert.ToString(GridView1.SelectedDataKey.Value);
Match match = Regex.Match(st, @"[0-9]+", RegexOptions.IgnoreCase);
if (match.Success)
{
update ward set status='admitted' where patient_id='" +st.Trim() + "'
}
Please check your "status" column datatype. is it acceptable string or any thing else like integer?
Thanks