Wednesday, 15 February 2012

c# - Getting error "An attempt to attach an auto-named database for file .... failed." -



c# - Getting error "An attempt to attach an auto-named database for file .... failed." -

i creating database based application. have created solution contains 2 projects

1) windows forms application

2) datalayer - have added sql server database folder.

i know related path not able figure out.

this 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 solution 1 time again , got same exception.

"an effort attach auto-named database file e:\xghprojects\billingkiosk\billingkiosk\bin\debug\db\billingdb.mdf failed. database same name exists, or specified file cannot opened, or located on unc share."

below property window of db file.

initially getting copied in billingkiosk's debug folder updated "copy output directory property not copy. have been through next links :

http://forums.asp.net/t/956274.aspx

http://social.msdn.microsoft.com/forums/sqlserver/en-us/6dfdcc22-7a81-4e8f-a947-c1ce6982d4b3/flustered-a-database-with-the-same-name-exists-or-specified-file-cannot-be-opened-or-it-is?forum=sqlexpress

"an effort attach auto-named database" error

an effort attach auto-named database file **** failed

an effort attach auto-named database error

do need alter construction of solution ?

c# sql-server database winforms windows-applications

No comments:

Post a Comment