database already exists please choose a different name
Here's the case I created this Permias.mdf on another solution that I had and then after that I decided not to use that solution and created a new website from visual studio and copy and paste the .mdf file to be used for this website.
Database 'C:\\Permias.mdf' already exists. Choose a different database nam开发者_如何学Pythone.
I think I finally understand what is happening:
You have project A, and it uses physical file C:\Permias.mdf
.
Now, you have project B, and you'd like to use C:\Permias.mdf
, so you paste it again in Visual Studio explorer - but, it already physically exists.
Is this correct? If so, you have some options:
Include the Permias.mdf into your Project B by right-clicking your solution root in the Solution Explorer, and click 'Add Existing File'.
Rename Permias.mdf to something else, or put it in a different folder/location, and make sure to update all references in your code.
Choose a different database name.
EDIT: Kidding! (Sort of.)
精彩评论