I am trying to use 2 databses in an application. Error is
Cannot attach the file 'D:\Documents\_VSC\ASP.NET\HazInfoSM\App_Data\evaris_rosql.mdf' as database 'evaris_rosql.mdf'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Cannot attach the file 'D:\Documents\_VSC\ASP.NET\HazInfoSM\App_Data\evaris_rosql.mdf' as database 'evaris_rosql.mdf'.
web config rows
what am I doing wrong?

Jignesh KumarPosted Jan 13, 2025, 5:05 AM
Hello Marius,
Please check you attachedDbFilename path is correct and fully accessible,
AttachDbFilename="D:\Documents\_VSC\Evaris\App_Data\evaris_rosql.mdf";Initial Catalog=evaris_rosql.mdf
Rather than using " use with
AttachDbFilename="D:\Documents\_VSC\Evaris\App_Data\evaris_rosql.mdf"
Marius VasilePosted Jan 19, 2025, 3:30 PM
It is working now, the path was not correct a folder was missing. :)
Marius VasilePosted Jan 19, 2025, 3:18 PM
Thank you Jignesh, I still have the error
Cannot attach the file 'D:\Documents\_VSC\ASP.NET\HazInfoSM\App_Data\evaris_rosql.mdf' as database 'evaris_rosql.mdf'.
with web.config like
However, if I declare the connection string locally, for example with
is working very well. What am I doing wrong in web.config?