Created
September 18, 2012 01:22
-
-
Save jaysonrowe/3740735 to your computer and use it in GitHub Desktop.
restore database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
res.RelocateFiles.Add(new RelocateFile(mdfname, dbpath + dbname + ".mdf")); | |
res.RelocateFiles.Add(new RelocateFile(ldfname, dbpath + dbname + "_log" + ".ldf")); | |
try | |
{ | |
res.SqlRestore(svr); | |
} | |
catch (FailedOperationException fox) | |
{ | |
str.WriteLine("{0} Exception caught.", fox.Message); | |
} | |
catch (Exception x) | |
{ | |
str.WriteLine("{0} Exception caught.", x); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment