title: how to bind data to select2 jquery from database in mvc
body: <p>View:</p>
  
  <pre><code>&lt;select multiple="" id="e2" tabindex="-1" class="select2-hidden-accessible" name="e2" aria-hidden="true"&gt;
      &lt;option value="PDS.RICE"&gt;PDS.RICE&lt;/option&gt;
      &lt;option value="PDS.WHEAT"&gt;PDS.WHEAT&lt;/option&gt;
      &lt;option value="PDS.DAL CHANNA"&gt;PDS.DAL CHANNA&lt;/option&gt;
      &lt;option value="PDS.DAL KALA CHANNA"&gt;PDS.DAL KALA CHANNA&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public ActionResult Getitems()
  {
      var items = (from m in db.ItemMasters select m).ToList();
      ViewBag.items = items;
      return View();
  }
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>public class ItemMaster
  {
      [Key]
      public int ItemId { get; set; }
      public string Item_Name { get; set; }
  }
  </code></pre>
  
  <p>I am trying to fetch the data from database in the controller, but unable to bind the <code>ViewBag</code> data to the <code>select2-hidden-accessible</code> in view.</p>