Thanks for answer.. I undestand the error and I know how it comes. But I like to know How the error generating from my code. Because When I inserting manually it not showing any such error.
But when we try to insert from UI code this error population.
Is there any problem in my Code ?
If I am right it is not necerssary to bring ID of the parent to insert in Child. Navigation does automatically it search ID for parent.
I did a similar test insertion using the NorthwindIB database with the same parent child relation and it worked. So I'm guessing that it has something to do with your Entity Data Model. Could you upload your edmx file to the forum?
I duplicated your database using the screenshots that you had sent me and I wrote the exact same logic (see below). I did not get any error. I've attached my edmx file. Maybe you can see what my edmx file is like and compare it to yours. Hopefully it will help.
var mgr = new ModelTestEntityManager();
ITEMVENDA novoItem = new ITEMVENDA();
novoItem.NOME = "some NOME text";
novoItem.VALORUNIT = 10;
VENDA novo = new VENDA();
novo.TIPOPAGAMENTO = "some TIPO text";
novo.VALORTOTAL = 10;
novo.ITEMVENDAs.Add(novoItem);
mgr.AddEntity(novo);
mgr.SaveChangesAsync(args => {
if (args.CompletedSuccessfully) {
Output = "Completed successfully";
} else {
Output = "Save operation has the following errors: " + args.Error.Message;
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum