Why do I get “Database already exists” when I'm using “AttachDbFileName” when I move the solution to another directory?

前端 未结 3 395
被撕碎了的回忆
被撕碎了的回忆 2021-01-24 02:32

I have an application JigSaw that uses a database TopScores.mdf which it is not included in the project. What I want to do is make the application find the database

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-24 02:44

    change setting in your connection string from "Database=TopScores.mdf" to something different, say: "Database=TopScores_brand_new_connection" do not create/delete/rename files in any file/database server. do it in the connection string only. Do not add dots, extensions etc.

提交回复
热议问题