Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7998269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:10:36+00:00 2026-06-04T15:10:36+00:00

So I added a BIT column to a table and now I need to

  • 0

So I added a BIT column to a table and now I need to make sure it is properly handled by the associated Windows Entity Framework class module.

Here’s what I added in Order_Header.cs:

     //New added column...
    public virtual bool REPORT_UPLOADED
    {
        get;
        set;
    }

But the file looks like it was auto-generated by some tool… If so which ? Should I just rerun that tool for the new column to be taken into account ? Anyways.

Now I went in the class module which implements the Save, Update, Select, etc. function for the entity:

    public override int Save(Entities.Master.Order_Header type)
    {
        try
        {
            using (var context = new Master_Data_Container(ConfigurationManager.MasterDataConnection()))
            {
                context.Order_Header.AddObject(type);

                return context.SaveChanges();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

    public override int Update(Entities.Master.Order_Header type)
    {
        try
        {
            using (var context = new Master_Data_Container(ConfigurationManager.MasterDataConnection()))
            {
                var orderHeader = context.Order_Header.First(n => n.ID == type.ID);

                orderHeader.ADR_FACT = type.ADR_FACT;
                orderHeader.ADR_RAPPORT = type.ADR_RAPPORT;                 
                orderHeader.REPORT_UPLOADED = type.REPORT_UPLOADED;
                orderHeader.STATUT = type.STATUT;
                orderHeader.TELEPHONE = type.TELEPHONE;
                orderHeader.TYPE_COMMANDE = type.TYPE_COMMANDE;
                orderHeader.TYPE_EXAMEN = type.TYPE_EXAMEN;

                return context.SaveChanges();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

I am not very familiar with the Entity Framework so I tried mimicking what was already done for another entity I have in this project which works fine.

The update seems to work fine, except for REPORT_UPLOADED which never updates. an SQL Profiler trace shows that the new property/column is being ignored 🙁

                        orderHeader.REPORT_UPLOADED = true;
                        orderHeader.POSTE = "WHATEVER";
                        int result = new MsDt_OrderHeader().Update(orderHeader);

Is there anything I’m missing ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:10:37+00:00Added an answer on June 4, 2026 at 3:10 pm

    You shouldn’t be adding code to auto generated files. You would need to make it a partial class and put all of your custom code into another file. The real issue though sounds like it is as Mark suggested, none of the metadata describing the mapping of your conceptual model to the storage model was updated.

    In Visual Studio, right click the .edmx file and select “Update Model from Database”. If you are using T4 templates to customize your classes, you’ll have to choose the template and select “Run Custom Tool”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a table with an active column of type bit that is mostly
I have a mapping like this <class name=UserFileSummary table=UserFile lazy=false> <id name=FileId column=UserFileId type=int>
I've added a history table to my database. Originally I added a Bit called
For an existing table in SQL compact 4 db Added a column of Type
I am puzzled with a query. I need find out the LAST row added
I just added a new field to my table in mysql and it came
I had to add a new column to my table so I did that
When using Linq-to-SQL, adding a column to an existing table, and setting a default
I needed to add a new NVARCHAR column to a table in my DB.
I have imported a SP to Entity Entity Data Model and added it to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.