Avatar of praveen1981
praveen1981
Flag for India asked on

database error

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.
ASP.NET

Avatar of undefined
Last Comment
praveen1981

8/22/2022 - Mon
Ivo Stoykov

Look here and here. Hope you'll find a solution.

HTH

Ivo Stoykov
ASKER CERTIFIED SOLUTION
13Shadow

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
praveen1981

ASKER
Thanks
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes