First you do not need this line
int result=Convert.ToInt32(cmd.ExecuteNonQuery());
, in case you need it, you do not have to convert cmd.ExecuteNonQuery() to int because already return an integer value.
Second at the end of your code add this line
dgv1.DataBind();
if that does not work, i suggest that you verify your select statement and make sure is building what you expect. for example put in comment all your code and just display your statement string in another label or text to double check is right.
Regards.