none
The Type datetime2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification RRS feed

  • Question

  • I want to use datetime2 on SQL 2012. Stuck Using Entity Framework 3.5 But I keep getting this error.

    EntitiesModel.AppEntities.ssdl(12712,6) : error 0040: The Type datetime2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification.

    In the ssdl I see

    <Property Name="CreateDateTime" Type="datetime2" Precision="0" />

    How do I fix?

    Wednesday, April 25, 2018 2:11 PM

Answers

  • EF 6 has Database first, using the edmx.  EF has vastly improved from its initial release using Entity Framework 3.5.  Maybe you should consider migrating to EF 6.
    • Marked as answer by flagrantHippo Thursday, April 26, 2018 1:13 PM
    Thursday, April 26, 2018 5:52 AM

All replies

  • what does the edmx content look like? Post it.....
    Wednesday, April 25, 2018 7:07 PM
  • Just learned that there was some post build script changing ProviderManifestToken="2008" to ProviderManifestToken="2005" in the ssdl file. Apparently ProviderManifestToken="2005" means only support sql 2005 data types. Once I got rid of this script 2008 types works. Even worse we are targeting SQL 2012. I can't find any edmx file. How do we set this to 2012? I don't see where this 2008 is coming from. Is EF 35 hard coded to only support 2008?
    Wednesday, April 25, 2018 7:55 PM
  • EF 6 has Database first, using the edmx.  EF has vastly improved from its initial release using Entity Framework 3.5.  Maybe you should consider migrating to EF 6.
    • Marked as answer by flagrantHippo Thursday, April 26, 2018 1:13 PM
    Thursday, April 26, 2018 5:52 AM