In your create method, you need to populated the list of values from the database using SqlConnection or Entity Framework connection. You can then use ViewBag variable to send the data to the view. The code might look as below:
public ActionResult create()
{
var subjects = dbContext.Subjects.ToList();
ViewBag.Subjects = new SelectList(subjects, "SubjectId", "SubjectName","");
return View();
}
This will give you the list of subject as ViewBag data in the create view.
In the view you can use either Select or DropDownList control to display the Subjects. For Select control you can use as below:
<select id="subjects" name="subjects" class="selectpicker show-tick form-control" title="">
@foreach (var item in ((IEnumerable<SelectListItem>)ViewBag.Subjects))
{
<option>@item.Text</option>
}
</select></select>
If you use DropDownList then you need to send the data from the controller view Model
@Html.DropDownListFor(m=>m.Subject, new SelectList(Model,"SubjectId","SubjectName"));
Hope this will help