Server sERvERr = new Server();
Restore rEStoRE = new Restore();
rEStoRE .Database = "SMO";
rEStoRE .Action = RestoreActionType.Database;
rEStoRE .Devices.AddDevice(@"C:\SMOTest.bak", DeviceType.File);
rEStoRE .PercentCompleteNotification = 10;
rEStoRE .ReplaceDatabase = true;
rEStoRE .SqlRestore(sERvERr );
Restore Database using SMORestore Database Using SMO
Page 1 of 1
2 Replies - 5706 Views - Last Post: 08 April 2009 - 08:34 AM
Replies To: Restore Database using SMO
#2
Re: Restore Database using SMO
Posted 08 April 2009 - 04:32 AM
What is your question?
#3
Re: Restore Database using SMO
Posted 08 April 2009 - 08:34 AM
Are you receiving any errors? Does this code not work that way you intended it? When asking for help there are a couple items that are vital in order for someone to properly help you:
- Post the code you're having problems with (DONE)
- Post the exact error you're receiving, if you are receiving one
- If no error explain what the code is doing versus what you want it to do
- Post your question in the body of your post, not the description field
Page 1 of 1