m@ndana
سه شنبه 04 آذر 1393, 22:26 عصر
سلام
دوستان من یک دیتایس دارم که وقتی به صورت دستی اونو در sql server management اتچ می کنم و توی #c برنامم رو اجرا می کنم restore کار می کنه.
با این command:
"USE [master] RESTORE DATABASE [dbname] FROM DISK = N'" + backupfile + "' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
ولی وقتی دیتابیسم رو از sql server management دیتچ می کنم و توی #c برنامم رو اجرا می کنم restore کار نمی کنه و با این error:
Additional information: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'e:\test\test\bin\Debug\dbname.mdf'.
File 'dbname' cannot be restored to 'e:\test\test\bin\Debug\dbname.mdf'. Use WITH MOVE to identify a valid location for the file.
The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'e:\test\test\bin\Debug\dbname_log.ldf'.
File 'dbname_log' cannot be restored to 'e:\test\test\bin\Debug\dbname_log.ldf'. Use WITH MOVE to identify a valid location for the file.
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
RESTORE DATABASE is terminating abnormally.
Changed database context to 'master'.
دوستان منتظر راهنماییتون هستم
دوستان من یک دیتایس دارم که وقتی به صورت دستی اونو در sql server management اتچ می کنم و توی #c برنامم رو اجرا می کنم restore کار می کنه.
با این command:
"USE [master] RESTORE DATABASE [dbname] FROM DISK = N'" + backupfile + "' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
ولی وقتی دیتابیسم رو از sql server management دیتچ می کنم و توی #c برنامم رو اجرا می کنم restore کار نمی کنه و با این error:
Additional information: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'e:\test\test\bin\Debug\dbname.mdf'.
File 'dbname' cannot be restored to 'e:\test\test\bin\Debug\dbname.mdf'. Use WITH MOVE to identify a valid location for the file.
The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'e:\test\test\bin\Debug\dbname_log.ldf'.
File 'dbname_log' cannot be restored to 'e:\test\test\bin\Debug\dbname_log.ldf'. Use WITH MOVE to identify a valid location for the file.
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
RESTORE DATABASE is terminating abnormally.
Changed database context to 'master'.
دوستان منتظر راهنماییتون هستم