title: The object cannot be deleted because it was not found in the ObjectStateManager when making a crud
body: <p>I am making a CRUD for admin table from my database and it gives me an error when deleting System.InvalidOperationException: 'The object cannot be deleted because it was not found in the ObjectStateManager.'
  and the update button does nothing,but if i update that row and than press the delete it does delete it without error</p>
  
  <pre><code>  private AdminContext _context;
      private Admin _selectedAdmin;
      public AdminCrudForm()
      {
          InitializeComponent();
  
          _context = new AdminContext();
  
      }
  
      private void AdminCrudForm_Load(object sender, EventArgs e)
      {
          // TODO: This line of code loads data into the 'libraryManagement01DataSet1.Admins' table. You can move, or remove it, as needed.
          this.adminsTableAdapter.Fill(this.libraryManagement01DataSet1.Admins);
  
      }
  
      private void DgvAdminCrud_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
      {
          _selectedAdmin = _context.Admins.Find(DgvAdminCrud.Rows[e.RowIndex].Cells[0].Value);
  
          TbAdminID.Text = _selectedAdmin.AdminID.ToString();
          TbAdminFullname.Text = _selectedAdmin.Fullname;
          TbAdminUsername.Text = _selectedAdmin.Username;
          TbAdminPassword.Text = _selectedAdmin.Password;
      }
  
      private void BtnAdd_Click(object sender, EventArgs e)
      {
  
  
              Admin admin = new Admin()
              {
                  Fullname = TbAdminFullname.Text,
                  Password = TbAdminPassword.Text,
                  Username = TbAdminUsername.Text
              };
  
              _context.Admins.Add(admin);
              _context.SaveChanges();
  
              this.adminsTableAdapter.Fill(this.libraryManagement01DataSet1.Admins);
  
      }
  
      private void BtnUpdate_Click(object sender, EventArgs e)
      {
          _selectedAdmin.Fullname = TbAdminFullname.Text;
          _selectedAdmin.Username = TbAdminUsername.Text;
          _selectedAdmin.Password = TbAdminUsername.Text;
  
          _context.SaveChanges();
  
  
  
          this.adminsTableAdapter.Fill(this.libraryManagement01DataSet1.Admins);
      }
  
      private void BtnDelete_Click(object sender, EventArgs e)
      {
          _context.Admins.Remove(_selectedAdmin);
          _context.SaveChanges();
  
          this.adminsTableAdapter.Fill(this.libraryManagement01DataSet1.Admins);
      }
  </code></pre>