简体   繁体   English

如何备份和恢复SQL服务器数据库文件?

[英]How to Backup and Restore SQL server database files?

I am using EF Core in.Net 6 App, The Project is almost Complete, But Now I want to code for Backup and Restore?我在 .Net 6 应用程序中使用 EF Core,项目几乎完成,但现在我想编写备份和恢复代码?

Here is code for EF, But it is not work for EF Core.这是 EF 的代码,但它不适用于 EF Core。 code . 代码

Backing up a database is not within the scope of an ORM. The code you linked to does not rely on Entity Framework it uses SQL Server Management Object (SMO).备份数据库不在 ORM 的 scope 内。您链接到的代码不依赖实体框架,它使用 SQL 服务器管理 Object (SMO)。 SMO requires .NET Framework 4.0 or .NET Core 2.0 to run. SMO 需要 .NET Framework 4.0 或 .NET Core 2.0 才能运行。 You can install the package from Nuget.您可以从 Nuget 安装package。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM