title: How to save dropdownlist selected value to the database int asp.net MVC 5
body: <p>I am currently new to Asp.net MVC .In one of the view I add a dropdownlist and I bind this dropdownlist with my database like this</p>
  
  <p>Controller <code>CollegeController</code></p>
  
  <pre><code>[HttpGet]
  public ActionResult Create()
  {
      IEnumerable&lt;SelectListItem&gt; items = db.College_Names.Select(c =&gt; new SelectListItem { Value = c.id.ToString(), Text = c.Name });
      IEnumerable&lt;SelectListItem&gt; item = db.Stream_Names.Select(c =&gt; new SelectListItem { Value = c.id.ToString(), Text = c.Stream });
      ViewBag.CollName=items;
      ViewBag.StreamName = item;
      return View();
  }
  
  [HttpPost]
  public ActionResult Create(College college)
  {
      try
      {
          if(ModelState.IsValid)
          {
              db.Colleges.Add(college);
              db.SaveChanges();
              return RedirectToAction("Index");
          }
          ViewBag.CollName = db.Colleges;
          return View(college);
      }
      catch
      {
          return View();
      }
  }
  </code></pre>
  
  <p>This is my model</p>
  
  <pre><code>public class College
  {
      [Required]
      public int Id { get; set; }
      [Required]
      [Display(Name="College Name")]
      public int CollegeName { get; set; }
      [Required]
      public int Stream { get; set; }
      [Required]
      [Column(TypeName="varchar")]
      public string Name { get; set; }
      ....
      public virtual College_Name College_Name { get; set; }
      public virtual Stream_Name Stream_Name { get; set; }
  }
  </code></pre>
  
  <p>This is My View</p>
  
  <pre><code>&lt;div class="form-group"&gt;
      @Html.LabelFor(model =&gt; model.CollegeName, htmlAttributes: new { @class = "control-label col-md-2" })
      &lt;div class="col-md-10"&gt;
          @Html.DropDownList("CollName", (IEnumerable&lt;SelectListItem&gt;)ViewBag.CollName, "Select College", new { @class = "form-control" })
          @Html.ValidationMessageFor(model =&gt; model.CollegeName, "", new { @class = "text-danger" })
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      @Html.LabelFor(model =&gt; model.Stream, htmlAttributes: new { @class = "control-label col-md-2" })
      &lt;div class="col-md-10"&gt;
          @Html.DropDownList("StreamName", (IEnumerable&lt;SelectListItem&gt;)ViewBag.StreamName, "Select Stream", new { @class = "form-control" })
         @Html.ValidationMessageFor(model =&gt; model.Stream, "", new { @class = "text-danger" })
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Now when I check my database after I save the <code>CollegeName</code> and <code>Stream</code> in the database is zero from the dropdownlist.</p>