CoyoteMoves.Data_Access.EmployeeDB.GetEmployeeIdsByGroupId C# (CSharp) Method

GetEmployeeIdsByGroupId() public method

public GetEmployeeIdsByGroupId ( int groupId ) : Collection
groupId int
return Collection
        public Collection<int> GetEmployeeIdsByGroupId(int groupId)
        {
            Collection<int> returnToSender = new Collection<int>();

            SqlConnection connection = new SqlConnection(_connectionString);
            string commandString = "SELECT [EmployeeID] FROM [Intern_CoyoteMoves].[dbo].[InternalEmployee] WHERE ([Group] = @Id)";
            SqlCommand command = new SqlCommand(commandString);
            command.Parameters.AddWithValue("@Id", groupId);
            command.Connection = connection;
            connection.Open();
            SqlDataReader reader = command.ExecuteReader();
            while (reader.Read())
            {
                returnToSender.Add((int)reader["EmployeeID"]);
            }
            connection.Close();

            return returnToSender;
        }