1

I have 5 tables in started projects. If I adds new table (Urun entity) writing below codes:

project.BAL :

public static List<Urun> GetUrun()
{
   using (GenoTipSatisEntities genSatisUrunCtx = new GenoTipSatisEntities())
   {
      ObjectQuery<Urun> urun = genSatisUrunCtx.Urun;
      return urun.ToList();
   }
}

if I receive data form BAL in UI.aspx:

using project.BAL;


namespace GenoTip.Web.ContentPages.Satis
{
    public partial class SatisUrun : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                FillUrun();
            }
        }

        void FillUrun()
        {
            ddlUrun.DataSource = SatisServices.GetUrun();
            ddlUrun.DataValueField = "ID";
            ddlUrun.DataTextField = "Ad";
            ddlUrun.DataBind();
        }
    }
}

I added URun later. error appears ToList method: EntityCommandCompilationException was unhandled bu user code

error Detail:

Error 1 Error 3007: Problem in Mapping Fragments starting at lines 659, 873: Non-Primary-Key column(s) [UrunID] are being mapped in both fragments to different conceptual side properties - data inconsistency is possible because the corresponding conceptual side properties can be independently modified. C:\Users\pc\Desktop\GenoTip.Satis\GenoTip.DAL\ModelSatis.edmx 660 15 GenoTip.DAL
Error 2 Error 3012: Problem in Mapping Fragments starting at lines 659, 873: Data loss is possible in FaturaDetay.UrunID.
An Entity with Key (PK) will not round-trip when:
(PK does NOT play Role 'FaturaDetay' in AssociationSet 'FK_FaturaDetay_Urun' AND PK is in 'FaturaDetay' EntitySet)
C:\Users\pc\Desktop\GenoTip.Satis\GenoTip.DAL\ModelSatis.edmx 874 11 GenoTip.DAL
Error 3 Error 3012: Problem in Mapping Fragments starting at lines 659, 873: Data loss is possible in FaturaDetay.UrunID.
An Entity with Key (PK) will not round-trip when:
(PK is in 'FaturaDetay' EntitySet AND PK does NOT play Role 'FaturaDetay' in AssociationSet 'FK_FaturaDetay_Urun' AND Entity.UrunID is not NULL)
C:\Users\pc\Desktop\GenoTip.Satis\GenoTip.DAL\ModelSatis.edmx 660 15 GenoTip.DAL
Error 4 Error 3007: Problem in Mapping Fragments starting at lines 748, 879: Non-Primary-Key column(s) [UrunID] are being mapped in both fragments to different conceptual side properties - data inconsistency is possible because the corresponding conceptual side properties can be independently modified. C:\Users\pc\Desktop\GenoTip.Satis\GenoTip.DAL\ModelSatis.edmx 749 15 GenoTip.DAL
Error 5 Error 3012: Problem in Mapping Fragments starting at lines 748, 879: Data loss is possible in Satis.UrunID.
An Entity with Key (PK) will not round-trip when:

(PK does NOT play Role 'Satis' in AssociationSet 'FK_Satis_Urun' AND PK is in 'Satis' EntitySet)
C:\Users\pc\Desktop\GenoTip.Satis\GenoTip.DAL\ModelSatis.edmx 880 11 GenoTip.DAL
Error 6 Error 3012: Problem in Mapping Fragments starting at lines 748, 879: Data loss is possible in Satis.UrunID.
An Entity with Key (PK) will not round-trip when:

(PK is in 'Satis' EntitySet AND PK does NOT play Role 'Satis' in AssociationSet 'FK_Satis_Urun' AND Entity.UrunID is not NULL)
C:\Users\pc\Desktop\GenoTip.Satis\GenoTip.DAL\ModelSatis.edmx 749 15 GenoTip.DAL

3
  • How did you create your model? Did you mess with the edmx file? Commented Apr 5, 2010 at 12:17
  • what do you mean sir???? "How did you create your model? Did you mess with the edmx file" Commented Apr 5, 2010 at 12:55
  • @Nix I also have this error, I added the table to the edmx file. I, too, get the following error: EntityCommandCompilationException was unhandled by user code. Do you have any idea on how to either revert the changes so that the site works again (prior to adding the table) and how I may correctly add tables to avoid this error in future Commented Aug 30, 2016 at 12:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.