Saturday 17 September 2011

[Solved] System.Data.SqlClient.SqlError Directory lookup for the file "Path" failed with the operating system error 2(error not found). (Microsoft.SqlServer.Express.Smo)

Problem:
While restoring the content Database backup(.bak) to newly created content database in the database list, you will find this Error message.

System.Data.SqlClient.SqlError Directory lookup for the file "Path" failed with the operating system error 2(error not found). (Microsoft.SqlServer.Express.Smo)

Solution:
To solve this problem, use the steps mentioned below.
1) Right click in the new database in the database list
2) Tasks --> Restore --> Database...
3) Select 'From device' option to browse the backup file location
4) Enable the Restore checkbox for Database Backup and Transaction Log Backup in the selected backup path
5) Go to Options in the top left --> Select the Overwrite the existing database option
6) Most Important: Check the newly created Database Path which is selected properly or not as per in the below mentioned screenshot.
 











7) Once you confirm with the database location, click OK to restore.