将数据从SQL数据库导出到MS Excel [英] Export data from SQL database into MS Excel

查看:101
本文介绍了将数据从SQL数据库导出到MS Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Web应用程序中,我想使用自定义标题将数据直接从SQL数据库直接下载到MS Excel.在网页中将有一个文本框,用户仅从该文本框中选择日期(其中包含弹出的日历),并且当用户单击下载按钮时,它将直接将数据下载到Excel中.我不想将大量数据绑定到GridView中,所以我想使用ASP.NET和C#将数据直接下载到Excel中.
我该如何实现?

解决方案

http://stackoverflow. com/questions/5621577/export-from-sql-server-to-excel-file-using-asp-net-and-vb-net [导出到Excel 相同格式的控件,轻松地从gridview转换为excel.

否则,将您的数据放入数据表中,然后将其导出为ex​​cel,如示例
http://www.dotnetboss.com /2010/05/13/how-to-datatable-export-to-excel-in-asp-net/


rupa,
将SQL Server数据导出到Excel [ 解决方案

http://dotnetguts.blogspot.com/2007/12/export-datagrid-to-excel-in-aspnet.html
http://stackoverflow.com/questions/5621577/export-from-sql-server-to-excel-file-using-asp-net-and-vb-net[^]


You can easily do it from gridview to excel by Export To Excel control with same format.

otherwise put you data in datatable and export it to excel as in example
http://www.dotnetboss.com/2010/05/13/how-to-datatable-export-to-excel-in-asp-net/


Hi rupa,
Export SQL Server Data to Excel[^]


这篇关于将数据从SQL数据库导出到MS Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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