I have a SOQL query and I want to add the results to a selectList and I'm not totally sure how. The documentation on selectList makes it look like I should loop through the results and add them as selectOptions to another list. But I'm having trouble with the syntax.
Here is the SOQL
public List<Contact> contacts { get; set; }
public PageReference searchContacts()
{
contacts = [select Id
,Name
from Contact
where FirstName LIKE :name+'%'];
return null;
}