title: When I update the database with a new row from the browser, why isn't the SQL Server database table updated?
body: <p>I'm building a blog web application using ASP.NET MVC and Linq-to-SQL database connection. </p>
  
  <p>When I update the database with a new row from the browser (view), the SQL Server database table doesn't get updated.</p>
  
  <p>My controller has two methods as follows:</p>
  
  <pre><code>public ActionResult Index()
  {
      IList&lt;Administrator&gt; AdministratorList = new List&lt;Administrator&gt;();
  
      var query = from administrator in context.Administrators
                  select administrator;
  
      var admins = query.ToList();
  
      foreach (var adminData in admins)
      {
         AdministratorList.Add(new Administrator()
          {
             Id = adminData.Id,
             PublicId = adminData.PublicId,
             Name = adminData.Name,
             Email= adminData.Email,
             MobilePhoneNumber = adminData.MobilePhoneNumber,
             Created = adminData.Created, 
             LastModifiedDate = adminData.LastModifiedDate,
             Code = adminData.Code, 
             CodeExpired = adminData.CodeExpired,
             Role = adminData.Role,
             Active = adminData.Active,
            // Password = adminData.Password
         });
      }
  
      return View(AdministratorList);
  }
  
  [HttpGet]
  public ActionResult Create()
  {
      Administrator model = new Administrator();
      return View(model);
  }
  
  [HttpPost]
  public ActionResult Create(Administrator model)
  {
      try
      {
          Administrator administrator = new Administrator()
          {
              Name = model.Name,
              Email = model.Email,              
              MobilePhoneNumber = model.MobilePhoneNumber,
              Created = model.Created,
              LastModifiedDate = model.LastModifiedDate,
              Code = model.Code,
              CodeExpired = model.CodeExpired,
              Role = model.Role,
              Active = model.Active,
              //Password = model.Password
          };
  
          context.Administrators.InsertOnSubmit(administrator);
          context.SubmitChanges();
  
          return RedirectToAction("Index");
      }
      catch
      {
          return View(model);
      }
  }
  </code></pre>