Hello I have an Entity "Candidate" which is set as a datasource for a GridView and a combobox. When i Update or Delete something, thw datasource is updated and the gridview and combobox show the changes.
However when i inser a new Entity then the data in the two controls doesnt refresh automatically. i have to close and reopen the form to see the changes.
My code is
AMSEntities objContext =new AMSEntities ();
private void btnInsert_Click(object sender, EventArgs e)
{
Candidate cand1 = new Candidate();
cand1.CandidateName ="Amir";
cand1.CandidateFatherName ="Asdf";
cand1.DOB =DateTime.Now;
objContext.Candidates.AddObject(cand1);
objContext.SaveChanges();
}