Mukesh Kumar Tiwari

Mukesh Kumar Tiwari

  • NA
  • 980
  • 252.5k

How To Restore .bak File in sql Database Using c#???

Aug 13 2014 5:53 AM
hi friends...
 
                     i have a .bak file of sql server database. and now i want to restore that database in the sqlserver database using c#.net.
 
                     i am using the below query
                   string query = "RESTORE DATABASE'"+cmd_database_list.Text.Trim()+"' FROM DISK = '" + txt_back_file.Text.Trim() + "'"; 
 
                     an error occured that 
                  Cannot open backup device 'E:\Print_Label13-08-2014.bak'. Operating system error 2(The system cannot find the file specified.).    
                     RESTORE DATABASE is terminating abnormally.
 
                i am not geting that what to do now????
                Please help me out...
Thanks... 
 

Answers (1)