I'm trying to deploy an ASP.NET web app connected to a SQL Server database. I'm trying to attach the database by uploading the .mdf
file but I always get an error:
System.Web.Services.Protocols.SoapException: Server was unable to process request.
--->
System.UnauthorizedAccessException: Access to the path 'c:\dzsqls\krginventorydb2.mdf' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at DZWebSvc.DZWebAgent.AttachNewUserDBDataFileOnly(String DBName, String LoginName, String OriginalDBFileName, String OriginalLogFileName, String NewDBFileName, Int32 MaxDataFileSizeMB, Int32 MaxLogFileSizeMB, String ConnectionString, Boolean ChangeDefaultSchemaToDbo, String tk)
--- End of inner exception stack trace ---
I am aware that I need to detach the db if it's currently active and so i did. The size of it is small enough to not exceed the maximum. I don't know what's wrong. Help. :(