I am creating a database based application. I have created a solution which contains 2 projects
1) Windows forms application
2) Datalayer - where i have added a sql server database to a folder.
I know that its something related to path but i am not able to figure it out.
This is the app.config of datalayer
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="BillingKioskDatalayer.Properties.Settings.BillingDBConnectionString"
connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\DB\BillingDB.mdf;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
I added 'User Instance=True' ran the solution again and got the same exception.
"An attempt to attach an auto-named database for file E:\XGHProjects\BillingKiosk\BillingKiosk\bin\Debug\DB\BillingDB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."
Below is the property window of the db file.
Initially it was getting copied in the billingkiosk's debug folder but then i updated "Copy to output directory property to Do Not Copy. I have been through following links :
http://forums.asp.net/t/956274.aspx
"An attempt to attach an auto-named database" error
An attempt to attach an auto-named database for file **** failed
An Attempt to attach an auto-named database Error
Do i need to change the structure of the solution ?