title: Error: Value Cannot be null. Parameter Name: Value
body: <p>I created a search page. There is a specialization field in which data is coming through EF.</p>
  
  <p>Here is the controller:</p>
  
  <pre><code>public ActionResult Search(string search)
  {
      DataTable dt;
      dt = this.GetSPDataTable("getAssociateData");
  
      List&lt;Associate&gt; list = new List&lt;Associate&gt;();
      list = (from DataRow dr in dt.Rows
              select new Associate
              {
                  AssociateId = Convert.ToInt32(dr["AssociateId"]),
                  Name = dr["Name"].ToString(),
                  Phone = Convert.ToInt64(dr["Phone"]),
                  Address = dr["Address"].ToString(),
                  SpecializationId = Convert.ToInt32(dr["SpecializationId"]),
                  SpcName = dr["SpcName"].ToString()
              }).ToList();
      return View(list.Where(x =&gt; x.Name.Contains(search) || search == null).ToList());
      //return View(db.Associates.Where(x =&gt; x.Name.Contains(search) || search == null).ToList());
  </code></pre>
  
  <p>here is the view:</p>
  
  <pre><code>@foreach (var item in Model)
  {
  
      &lt;tr&gt;
          &lt;td&gt;
              @item.Name
          &lt;/td&gt;
          &lt;td&gt;
              @item.Phone
          &lt;/td&gt;
          &lt;td&gt;
              @item.Address
          &lt;/td&gt;
          &lt;td&gt;
              @item.SpcName
          &lt;/td&gt;
  </code></pre>
  
  <p>and at last Model:</p>
  
  <pre><code>[Key]
  public int AssociateId { get; set; }
  
  [Required(ErrorMessage = "You must provide a name")]
  [MaxLength(10)]
  public string Name { get; set; }
  
  [Required(ErrorMessage = "Please Write Your Number ")]
  [RegularExpression(@"^([0-9]{10})$", ErrorMessage = "Invalid Mobile Number.")]
  public Nullable&lt;long&gt; Phone { get; set; }
  
  [Required(ErrorMessage = "Where do you dwell")]
  [MaxLength(50)]
  public string Address { get; set; }
  
  [Display(Name = "Specialization")]
  [Required(ErrorMessage = "Select any of them")]
  public Nullable&lt;int&gt; SpecializationId { get; set; }
  
  [Display(Name = "Specialization")]
  public string SpcName { get; set; }
  </code></pre>
  
  <p>I am getting an error on the null.</p>