Solved

database error

Posted on 2014-01-06
3
199 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
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
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 …

786 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