单击即可通过邮件备份数据库 [英] backup of databse via mail on a single click

查看:106
本文介绍了单击即可通过邮件备份数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要用于在某些mail_id(例如abc@abc.com)上发送database.mdf备份的代码.
我只需要单击一个按钮即可编写代码.

i need code for sending the backup of database.mdf on some mail_id like abc@abc.com.
i need to write a code on click of a single button.

thanks in advance.

推荐答案

如果这是SQL Server,则基本原理可能类似于:

If this is SQL Server, the basic principle could be like:

  • Use for example: BACKUP DATABASE[^] to take a full backup of your database
  • 发出备份时,为备份文件定义一个适当的位置
  • execute the backup command for example using SqlCommand[^]
  • use MailMessage[^] to compose a mail
  • define the backup file as an attachment in Attachments [^]


Google会显示所有内容.这是有关发送电子邮件的CodeProject文章:

使用C#通过SMTP发送邮件 [
Google reveals all. Here''s a CodeProject article on sending email:

Sending Mail Using C# via SMTP[^]


这篇关于单击即可通过邮件备份数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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