I am new to entity frame work
when trying to insert data to Database
iam gettin error "'System.Data.Objects.ObjectSet' does not contain a definition for 'Add' and no extension method 'Add' accepting a first argument of type 'System.Data.Objects.ObjectSet' could be found (are you missing a using directive or an assembly reference?)"
protected void Button1_Click(object sender, EventArgs e)
{
welcometestingEntities context = new welcometestingEntities();
department obj = new department();
obj._name = TextBox1.Text;
obj._location = TextBox2.Text;
context.Departements.Add(obj); //error on this line
//--- Bind data to repeater.
bindStudentInfo();
//--- Show confirmation message in label.
//--- Clear text from textboxes
}
please help me
thanks

ali tuncerRank #1,499 · 1.1K reputationPosted May 15, 2016, 6:25 PM EDT
try this way :
prabhu p172 reputationPosted May 16, 2016, 12:52 AM EDT
ali tuncerRank #1,499 · 1.1K reputationPosted May 16, 2016, 8:45 PM EDT
are you sure it is Departements?
by default, it should be departments..
Vincent Maverick DuranoRank #238 · 10.3K reputationPosted May 17, 2016, 7:16 AM EDT