如何备份Sql数据库在C# [英] How to backup Sql Database Programmatically in C#

查看:144
本文介绍了如何备份Sql数据库在C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用C#in .Net 4 FrameWork编写一个代码来备份我的Sql Server 2008数据库。

解决方案

http://www.mssqltips.com/sqlservertip/1849/backup-and-restore-sql-server-databases -programmatically-with-smo /



以下链接已解释了如何使用c#

$ b $回退sql server 2008数据库的完整详细信息b

Sql数据库备份可以通过多种方式完成。您可以像使用其他答案一样使用Sql命令,也可以创建自己的类来备份数据。



但这些是不同的备份模式。

$ b
  • >
  • 使用压缩进行备份

  • 但这种方法的缺点是需要您的sql管理工作室安装在您的客户端系统上。


    I want to write a code to backup my Sql Server 2008 Database using C# in .Net 4 FrameWork. Can anyone help in this.

    解决方案

    http://www.mssqltips.com/sqlservertip/1849/backup-and-restore-sql-server-databases-programmatically-with-smo/

    The following Link has explained complete details about how to back sql server 2008 database using c#

    Sql Database backup can be done using many way. You can either use Sql Commands like in the other answer or have create your own class to backup data.

    But these are different mode of backup.

    1. Full Database Backup
    2. Differential Database Backup
    3. Transaction Log Backup
    4. Backup with Compression

    But the disadvantage with this method is that it needs your sql management studio to be installed on your client system.

    这篇关于如何备份Sql数据库在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆