从单个sql2008r2导入数据到exel sheel并通过邮件发送 [英] importing data from a single sql2008r2 to exel sheel and sending it through mail

查看:114
本文介绍了从单个sql2008r2导入数据到exel sheel并通过邮件发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个要求.....



我想要数据来自sql table to exel sheet和

想要在邮件上发送exel sheel。所有这些步骤都是在没有任何用户干预的情况下完成的。

使用远程服务器连接



我也很困惑我在哪里创建exel表因为应用程序和数据库都在远程服务器上



和邮件每天只在特定时间发送一次





谢谢



I have one requirement.....

I want data from sql table to exel sheet and
want to send that exel sheel on mail.All these steps are completed without any user intervention
by using remote server connection

I am also confused where do I create the exel sheet because both application and database are on remote server

And the mail is sent only once per day at particular time


Thanks

推荐答案

您可以编写Windows服务或安排包含代码的控制台应用程序 -

步骤1:从远程服务器检索数据(假设您有数据库IP,用户名和密码)

第2步:将检索到的数据存储到数据表中。

步骤3:将数据从datatable导出到excel 。

第4步:使用excel文件作为附件发送邮件。


您可以通过Google搜索获得帮助。 :)



注意:excel表格将在运行您设计的控制台应用/赢取服务的机器上创建。
You can write a windows service or schedule a console application which contains codes for -
Step 1: Retrieve Data from Remote Server (Assuming you have database ip, username and password)
Step 2: Store retrieved data into a datatable.
Step 3: Export data from datatable to excel.
Step 4: Send a mail with the excel file as an attachment.

You can get help with steps by googling. :)

Note: the excel sheet will be created on the machine which runs the console app/win service designed by you.


这篇关于从单个sql2008r2导入数据到exel sheel并通过邮件发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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