Solved

database error

Posted on 2014-01-06
3
204 Views
Last Modified: 2014-01-20
Hi,

i am using entity frame work datafirst and my connection string contains as follow


  <add name="DefaultConnection" providerName="System.Data.SqlClient"
connectionString="Data Source=(LocalDb)\v11.0;
Initial Catalog=aspnet-Core.Portal-20131125172348;
Integrated Security=SSPI;
AttachDBFilename=|DataDirectory|\aspnet-Core.Portal-20131125172348.mdf" />  



now i am getting following error


Cannot attach the file

'D:\Halcyon\Projects\GymTrainer\Trunk\Core.Portal\
App_Data\aspnet-Core.Portal-20131125172348.mdf'
 
as database 'aspnet-Core.Portal-20131125172348'.


could you please say me how to resolve it. most of sites saying to delete database,

but don't we have any other solution with out deleting it.
0
Comment
Question by:praveen1981
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 22

Expert Comment

by:Ivo Stoykov
ID: 39761415
Look here and here. Hope you'll find a solution.

HTH

Ivo Stoykov
0
 
LVL 3

Accepted Solution

by:
13Shadow earned 500 total points
ID: 39762220
Can you debug it and see that indeed your =|DataDirectory| is indeed resolving to 'D:\Halcyon\Projects\GymTrainer\Trunk\Core.Portal\
App_Data ?
0
 

Author Closing Comment

by:praveen1981
ID: 39796138
Thanks
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question