So I am presuming that the error is occuring becuase the backup is being initiated as the user that is running the C# program, and SQL server is having none of it. If I were to run the backup on the instance referenced, in SSMS, I can backup to the Bakup location that is specified. String BackupLocation = + User.ToString() + ".bak" ĭbBackup.Action = BackupActionType.Database ĭ(BackupLocation, DeviceType.File) ĭbBackup.BackupSetName = "Test database backup" ĭbBackup.ExpirationDate = (10) ĭbBackup.PercentComplete += CompletionStatusInPercent Ĭannot open backup device - Operating System error 5 ![]() String SqlInstance = User = ExtractPureUsername(.GetCurrent().Name) I have created a class to backup a database, the code is: public bool BackupDatabase(string databasename) Advantech is a leading brand in IoT intelligent systems, Industry 4.0, machine automation, embedding computing, embedded systems, transportation, environment.
0 Comments
Leave a Reply. |