none
Regarding removing column in database RRS feed

  • Question

  • Currently I created the database first, then I use the entity framework 4.1 to access the database.

    The example is like this:

    The database has one table named users has two column,they are password and ConfirmedPassword.

    And in my application I use the following code.

    public class user

    {

    public string password

    {

    get;

    set;

    }

    public string ConfirmedPassword

    {get;set;}

    }

    I find that if I delete the ConfirmedPassword in database and in user,

    when I create new user and call db.SaveChanges(), it still show that the ConfirmedPassword and Discriminator is invalid.


    video edit

    Thursday, March 1, 2012 2:52 AM

Answers

  • Hi Tony,

    I guess you may use DbContext Generation Item, right?  If in this case, you should open your edmx and delete the property on desinger, when you save edmx file, there is a alert for reloading your entities.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 2, 2012 6:17 AM
    Moderator

All replies