I would to insert data from my controller to table customer which have a foreign key from active_customer, no_peserta is the foreign key which refer to active_customer table its my code
Code
var cus = new Customer {
no_peserta =17,
nama_customer=nama,
no_ktp=noktp,
no_hp=nohp,
tanggal_lahir=tgllahir
};
context.Customer.Add(cus);
context.SaveChanges();
but till now its still not work .If you have solution for this please tell me
The error page says " An exception of type 'System.Data.Entity.Infrastructure.DbUpdateException' occurred in EntityFramework.dll but was not handled in user code
Additional information: Unable to update the EntitySet 'Customer' because it has a DefiningQuery and no element exists in the element to support the current operation."
Manas MohapatraRank #182 · 13.2K reputationPosted Aug 19, 2015, 10:31 PM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Aug 19, 2015, 10:45 PM EDT