Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9180569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:05:27+00:00 2026-06-17T18:05:27+00:00

I got an error while I’m trying to restore a SQL Server 2008 R2

  • 0

I got an error while I’m trying to restore a SQL Server 2008 R2 database:

Restore failed for Server ‘KIMO-PC’.

Code used:

    Server myServer = new Server("KIMO-PC");
    Database myDatabase = new Database(myServer, "POS");
    Restore restoreDB = new Restore();
    restoreDB.Database = myDatabase.Name;
    restoreDB.Action = RestoreActionType.Database;
    restoreDB.Devices.AddDevice(FileName, DeviceType.File);

    restoreDB.ReplaceDatabase = false;

    restoreDB.NoRecovery = true;

    restoreDB.PercentComplete += CompletionStatusInPercent;
    restoreDB.Complete += Restore_Completed;

    restoreDB.SqlRestore(myServer);

and here is the exception details

Microsoft.SqlServer.Management.Smo.FailedOperationException was unhandled HelpLink=http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1540+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476 Message=Restore failed for Server 'KIMO-PC'.
 Source=Microsoft.SqlServer.SmoExtended Operation=Restore 
StackTrace: at Microsoft.SqlServer.Management.Smo.Restore.SqlRestore(Server srv) at ICS.Forms.frmRestore.Restoredb(String FileName) 
  in D:\POS\POS\POS\Database\RestoreDB.cs:line 56 at ICS.Forms.frmRestore.btnBackup_Click(Object sender, EventArgs e) 
  in D:\POS\POS\POS\Database\RestoreDB.cs:line 35 at System.Windows.Forms.Control.OnClick(EventArgs e) 
  at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.PerformClick() 
  at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData) 
  at System.Windows.Forms.Control.ProcessDialogKey(Keys keyData) 
  at System.Windows.Forms.Control.PreProcessMessage(Message& msg) 
  at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg) 
  at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg) 
  at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(MSG& msg) 
  at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) 
  at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) 
  at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) 
  at System.Windows.Forms.Application.Run(Form mainForm) at POS.Program.Main() in D:\POS\POS\POS\Program.cs:line 18 
  at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) 
  at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) 
  at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) 
  at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) 
  at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() 
InnerException: Microsoft.SqlServer.Management.Smo.SmoException HelpLink=http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1540+)&LinkId=20476 
  Message=System.Data.SqlClient.SqlError: Cannot open backup device 'C:\Users\kimo\Desktop\POS.bak'. Operating system error 5(failed to retrieve text for this error. Reason: 15100). 
  Source=Microsoft.SqlServer.Smo StackTrace: 
  at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQueryWithMessage(StringCollection queries, ServerMessageEventHandler dbccMessageHandler, Boolean errorsAsMessages) 
  at Microsoft.SqlServer.Management.Smo.BackupRestoreBase.ExecuteSql(Server server, StringCollection queries) 
  at Microsoft.SqlServer.Management.Smo.Restore.SqlRestore(Server srv) InnerException
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:05:28+00:00Added an answer on June 17, 2026 at 6:05 pm

    Take a look at the stack trace inner exception:

    Cannot open backup device ‘C:\Users\kimo\Desktop\POS.bak’. Operating
    system error 5

    Most likely, the SQL Server does not have rights to view files in kimo\Desktop. Move the backup to a different folder like c:\temp and try it again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got this error while trying to compile the below code. I would like
I got this error while trying to get facebook access_token from node.js server: {error:{message:(#803)
i got this error while trying to rebind a grid: ( Parent page (
Got this error message while trying to load view: The model item passed into
Got this error message while trying to configure an entitydatasource in the designer: My
I got the following error while trying to alter a column's data type and
I got RJS error: TypeError: element is null while using ajax. I used in
I have got an error while trying to upgrade our large project to SL4.
Permission denied (publickey,keyboard-interactive) got this error while i am trying to cvs checkout from
I have got an(other) error while trying to upgrade our large project to SL4.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.