简体   繁体   English

使用SQL查询创建和通过电子邮件发送报告

[英]Using SQL Query to create and e-mail a Report

I am new to C# and still have a lot to learn. 我是C#的新手,但仍有很多东西要学习。 My lecturer thought I would be a great exercise to trough me into the deep end and give me this exercise to do: 我的讲师认为我将是一项很棒的练习,它可以使我深入研究并给我做以下练习:

Write a C# Windows application that uses a SQL query string to generate a report; 编写一个使用SQL查询字符串生成报告的C#Windows应用程序; you must then be able to e-mail this report to 5 different e-mail addresses. 然后,您必须能够将此报告通过电子邮件发送到5个不同的电子邮件地址。 This application has to be compatible with any SQL database. 该应用程序必须与任何SQL数据库兼容。

This is the only information I have (I can ask my lecturer for more information, but it would be nice to figure it out on my own – or let her think I figured it out on my own). 这是我唯一的信息(我可以向我的讲师询问更多信息,但是最好自己解决-或者让她认为我自己解决了)。

Can anyone please maybe give me some pointers on how to start and what will the best Report format be for an application like this? 谁能给我一些有关如何启动的指针,以及对于像这样的应用程序而言最佳的报告格式是什么?

I am completely lost; 我完全迷路了; help will be very much appreciated. 帮助将不胜感激。

Thanks in advance! 提前致谢!

EDIT: I really don't know, but from the whole "compatible with any SQL database" tells me that maybe the application must open on where you could input your database information, to make a connection to the/any database, and then going to a new screen where you can input the query, then the application must write the report (it would be nice to actually see the report before you e-mail it), I think you have to be able to e-mail the report from within the application. 编辑:我真的不知道,但是从整体上讲“与任何SQL数据库兼容”告诉我,也许应用程序必须在您可以输入数据库信息的地方打开,以建立与任何数据库的连接,然后再进入到可以输入查询的新屏幕,然后应用程序必须编写报告(在通过电子邮件发送报告之前先实际查看报告是很高兴的),我认为您必须能够通过电子邮件发送报告在应用程序中。

Hope this make sense, is something like this possible? 希望这有道理,这可能吗?

I you have to mail the report .PDF will be the best option. 我必须邮寄报告。PDF将是最佳选择。 You can use the ItextSharp to generate the PDF report after retrieving the rows from the database. 从数据库检索行之后,可以使用ItextSharp生成PDF报告。

And then mail the PDF to the whomever you want. 然后将PDF邮寄给您想要的任何人。

You can easily get the Itextsharp dll from http://sourceforge.net/projects/itextsharp/ 您可以从http://sourceforge.net/projects/itextsharp/轻松获取Itextsharp dll。

Documentation for this is also easily available. 与此相关的文档也很容易获得。

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

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