title: Save checkbox list value Sql database in MVC5
body: <p>I want to store fields and checkboxes in a database table in a form: The connection table contains the following fields:</p>
  
  <p>connection table: </p>
  
  <pre><code>public  partial class Connection
  {
      [Key]
      public int ID { get; set; }
      public string CommunicationName { get; set; }
      public bool IsSelected { get; set; }
  }
  </code></pre>
  
  <p>Register table:</p>
  
  <pre><code>public class RegisterForm
  {
      #region Ctor
      public RegisterForm()
      {
  
      }
      #endregion Ctor
  
      #region Properties
  
      [Key]
      [Required]
      public int ID { get; set; }
  
      [Required(ErrorMessage = ("Required"))]
      [StringLength(50, ErrorMessage = "This field must be a maximum of 50 characters")]
      [TypeConverter("NVarchar(121)")]
      [DisplayName("FullName")]
      public string FullName { get; set; }
  
      public string Email { get; set; }
  
      public List&lt;Connection&gt; Communications { get; set; }   
  }
  </code></pre>
  
  <p>The values of the checkbox fields in the list are displayed using the following method:</p>
  
  <pre><code>questionForm.Communications = db.Connections.ToList&lt;Connection&gt;();
  </code></pre>
  
  <p>Now how to save the information in the post and save it to the register table. ????????? What changes should be Create to the update, delete operation in the register?</p>
  
  <p>controller for register:</p>
  
  <pre><code>[HttpPost]
  [ValidateAntiForgeryToken]
  public ActionResult Create([Bind(Include = "ID,FullName,PhoneNumber,Email,Communication,")]RegisterForm questionForm)
  {
      if (ModelState.IsValid)
      {             
          db.Registers.Add(questionForm);
          var data = db.SaveChanges();
              return View("FormSuccessfullySubmitted");              
      }
          return View(questionForm);
  }
  </code></pre>