views:

942

answers:

1

Tried this in as connection string

connectionString="Server=.\SQLEXPRESS;
    AttachDbFilename=E:\Database\dnn49.mdf;Database=dnn49; 
    Trusted_Connection=Yes;"

but i get an error

Unable to open the physical file "E:\Database\dnn49.mdf". Operating system error 5: "5(Access is denied.)". Cannot attach the file 'E:\Database\dnn49.mdf' as database 'dnn49'.

What gives?

+1  A: 

You must check the SQL Server Service account has modify permissions over the physical file "dnn49.mdf" , and modify permissions also over the folder that contains the file.

Bye.

RRUZ