Using the SqlCommand object and the SqlConnection class.
Something similar to:
SqlConnection conn = new SqlConnection();
... set conn properties
SqlCommand cmd = new SqlCommand();
... set cmd properties
cmd.CommandText = "SELECT Count(Activity) FROM [Activities] where Activity = 7
Object temp = cmd.ExecuteScalar();
label.Text = temp.ToString();
And add try,catch, etc.