EF with (LocalDb) V11.0

Source: Internet
Author: User

EF support for LocalDB is good, but LocalDB has its own flaws (do not want SQLite as the database files can be used like ordinary files).

LocalDB on a computer will have a unique constraint on the database, requires that the localdb of the machine cannot have the same name. If you do not notice this, you will have the following problems:

Cannot attach the file ' {0} ' as database ' {1} '

EF Codefirst cannot create a new database (LOCALDB) When you specify a different database file path to create a new database with the same name.

Ways to remove LocalDB

You cannot delete a file simply by using a tool or command line to delete it:

1.SqlServer Management Studio or SQL Server Object Explorer:

Or

2.VS Developer Command Prompt

Pm> sqllocaldb.exe Stop v11.0    "v11.0"  stopped.    PM>     pmDelete v11.0    "v11.0"  deleted.    PM> Sqllocaldb.exe start v11.0    "v11.0" started.

See more details:

Https://stackoverflow.com/questions/13275054/ef5-cannot-attach-the-file-0-as-database-1

EF with (LocalDb) V11.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.