locked
Update Model from Database RRS feed

  • Question

  • Hi,

    I have reinstalled my PC and installed only VS2015 and SQL 2014.

    Now when I do "Update model from database", all the user defined SQL types parameter are removed from functions and SP in the model. When I had VS2013 installed it worked.

    What do I miss?

    Thanks

    Eric

    Wednesday, October 28, 2015 12:00 PM

Answers

  • Changing from one VS Version to another while using EntityFramework is a bad idea.

    EF needs some Scripts to generate the model. However, VS Versions do not use the same Script to generate the model. Therefor, your issue could just be, that you need to redo the whole edmx file with a newly installed EF (i really mean delete the project and create it again, the use nuget to install the EF to this new project and generate the model from scratch) or ofc just go back to VS13 (use VM's for coding... its way easier to get out of these kinda problems).

    It is really annoying and stupid, but i had this issue with VS13 and VS15 too (some coworkers were already using VS15 while others were still using VS13, those with VS13 could not work with VS15 created EF projects and vice versa)

    Happy coding

    Tuesday, November 3, 2015 11:32 AM

All replies

  • Hi Eric,

    I am trying to reproduce your scenario and used my personal database with SQL2014

    and VS2015, but there is no such issue.  Can you try dig deep to find more useful info

    about this issue or let me know how to reproduce this issue? Please use your OneDrive

    to share a code sample or a screenshot to make this problem clearly.

    Best Regards, 

    Vince Li

    Tuesday, November 3, 2015 8:50 AM
  • Thank you.

    Probably difficult to reproduce, because I'm not sure which bits are exactly involved.

    As example:

    CREATE FUNCTION [address].[fncFindSimilar]
    (	
    	@FirmenName [dbo].[Description] = NULL,
    	@Nachname [dbo].[ShortDescription] = NULL,
    	@Vorname [dbo].[ShortDescription] = NULL,
    	@NurAktive BIT = 1,
    	@NurPerson BIT = 0,
    	@NurGeschaeft BIT = 0,
    	@IsPhonetisch BIT = 0
    )
    

    looks in the model like that:

    CREATE FUNCTION [address].[fncFindSimilar]
    (	
    	@NurAktive BIT = 1,
    	@NurPerson BIT = 0,
    	@NurGeschaeft BIT = 0,
    	@IsPhonetisch BIT = 0
    )
    

    This usually happens with user-defined table types, but not data types

    Thank you

    Tuesday, November 3, 2015 9:51 AM
  • Changing from one VS Version to another while using EntityFramework is a bad idea.

    EF needs some Scripts to generate the model. However, VS Versions do not use the same Script to generate the model. Therefor, your issue could just be, that you need to redo the whole edmx file with a newly installed EF (i really mean delete the project and create it again, the use nuget to install the EF to this new project and generate the model from scratch) or ofc just go back to VS13 (use VM's for coding... its way easier to get out of these kinda problems).

    It is really annoying and stupid, but i had this issue with VS13 and VS15 too (some coworkers were already using VS15 while others were still using VS13, those with VS13 could not work with VS15 created EF projects and vice versa)

    Happy coding

    Tuesday, November 3, 2015 11:32 AM