I am getting this error:
{"An attempt to attach an auto-named database for file D:\WORK\DocStore\DocStore\Database\DocStore.mdf\ failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."}
I verified the file exists and is checked out for edit.
This is in my app.config:
I am populating the DataDirectory like this:Code:<connectionStrings>
<add name="DocStoreEntities" connectionString="metadata=res://*/Database.DocStore.csdl|res://*/Database.DocStore.ssdl|res://*/Database.DocStore.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|;Integrated Security=True;Connect Timeout=30;User Instance=True;MultipleActiveResultSets=True""
providerName="System.Data.EntityClient" />
<add name="DocStore.My.MySettings.DocStoreConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
My.Settings.DatabaseLocation = "D:\WORK\DocStore\DocStore\Database\DocStore.mdf"
AppDomain.CurrentDomain.SetData("DataDirectory", My.Settings.DatabaseLocation)
Is it due to the "/" at the end of my .mdf\ ?
If it is, where is it coming from?
Any help would be greatly appreciated!
Thanks,
Eroc
