I like to use a static method in these cases. on your controller
public static List<SelectListItem> GetDropDown(){
List<SelectListItem> ls = new List<SelectListItem>();
var data = //call the database;
foreach(var temp in data){
ls.Add(new SelectListItem() { Text = temp.Text, Value = temp.Value });
}
return ls
}
and then on your view
@Html.DropDownList("ProjectId", PathToController.GetDropDown())