You can use ExecuteScalar method of SqlCommand class. Sample code is:
SqlConnection connection = new SqlConnection(myConnectionString);
SqlCommand cmd = connection.CreateCommand();
cmd.CommandText = "SELECT count(EmpID) FROM Employee";
int result = ((int)cmd.ExecuteScalar());
connection.Close();