Devart.Data.Linq.ForeignKeyReferenceAlreadyHasValueException
Posted: Wed 28 Nov 2018 08:59
I have this code:
(Ids, Ida and Idf They are Entity Key)
at the line: ff.Ids = (int)textS.Tag;
I get this the error: Devart.Data.Linq.ForeignKeyReferenceAlreadyHasValueException.
I read other posts but I can not figure out how to fix this
Code: Select all
WegDataContext db = new WegDataContext();
Fornisceforniamo ff = new Fornisceforniamo();
ff=db.Fornisceforniamos.FirstOrDefault(u => u.Idf == _idf && u.Ida == _ida && u.Ids==_ids);
ff.Ida = textIdA.Text;
ff.u = dataAgg.Value;
ff.p = p.Valore(); //my component
ff.Ids = (int)textS.Tag;
db.SubmitChanges();
at the line: ff.Ids = (int)textS.Tag;
I get this the error: Devart.Data.Linq.ForeignKeyReferenceAlreadyHasValueException.
I read other posts but I can not figure out how to fix this