try this ..
protected void GridView2_RowEditing(object sender, GridViewEditEventArgs e)
{
SqlConnection conn = new SqlConnection(ConnString);
int srNo = Convert.ToInt32(GridView1.DataKeys[e.NewEditIndex].Value);
SqlCommand cmd = new SqlCommand("Select * from Customer where Sr_No= @SrNo", conn);
Cmd.parameters.AddwithValue("@SrNo",srNo);
conn.Open();
SqlDataReader reader = cmd.ExecuteReader();
reader.Read();
{
txtCity.Text = reader["City"].ToString();
reader.Close();
}
conn.Close();
}