The back up code is working fine.
When i am trying to restore the taken back up, i am receiving an error as follows.
Cannot open backup device 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\myDb10-9-2009.bak'. Operating system error 2(The system cannot find the file specified.).
RESTORE DATABASE is terminating abnormally.
I am storing the .bak file in my E:\, but i am receiving an error of the default back up directory of MS-SQL Server 2005.
I have tried to restore the database with same .bak file through MS-SQL Server 2005, its working fine, but when i try through my code its giving the above error.
Following is my code.
Java Code Code Code Code Code Code Code |
Please help, i am going nuts.
Thanks,
Sandeep

Roei BarRank #1,271 · 1.4K reputationPosted Sep 11, 2009, 7:31 AM EDT
here is a nice post from CodeProject on HowTO:
http://www.codeproject.com/KB/database/SQL_Server_2005_Database.aspx
hope this helps
Master BillaRank #2,229 · 630 reputationPosted Sep 11, 2009, 9:03 AM EDT
Just work like this way, it will help to you get it work success
http://www.geekpedia.com/tutorial180_Backup-and-restore-SQL-databases.html
thank you