title: MVC Error "is of type 'System.Int32' but must be of type 'IEnumerable<SelectListItem>'. "
body: <p>I have a model like this;</p>
  
  <pre><code>    public int ID{ get; set; }
      public string MidName{ get; set; }
      public string FirstName{ get; set; }
      public string Surname{ get; set; }
  </code></pre>
  
  <p>This is my controller:</p>
  
  <pre><code>  public ActionResult Create(){
         ViewBag.Names= new SelectList(db.TbName, "ID", "MidName");
         return Viwe();
      }
  </code></pre>
  
  <p>This is my view
          </p>
  
  <pre><code>        @Html.LabelFor(model =&gt; model.Names, new { @class = "control-label col-md-2" })
          &lt;div class="col-md-10"&gt;
              @Html.DropDownList("Names", String.Empty)
              @Html.ValidationMessageFor(model =&gt; model.Names)
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Now when click create button i get an error saying</p>
  
  <blockquote>
    <p>`The ViewData item that has the key 'Names' is of type 'System.Int32'
    but must be of type 'IEnumerable'.</p>
  </blockquote>
  
  <p>I am getting this error is it because ID is int, if yes then how do i convert it? </p>