如何在asp.net中将数据库数据表导出到Excel表格?

发布于 2024-08-24 18:06:06 字数 260 浏览 4 评论 0原文

我有一个要求,我有一个 400 列的表。

这里我需要将此表导出到 Excel 工作表。

我需要上传到 Open Office Sheet。我没有 MS-office。

这是在 ASP.NET 和 C#.NET 中,

我对这个概念很陌生。

所以请帮我解决这个问题。

朋友们有一个问题,我有 400 列,无法插入到 Open Office Excel 中,我需要将其他列插入到新工作表中

谢谢大家!

I have a requirement that , i have a table of 400 columns.

Here i need to Export this table to Excel sheet.

And i need to upload to Open Office Sheet. I do not have MS-office.

This is in ASP.NET and C#.NET

I am new to this concept.

So please help me to solve this.

And friends there is a problem , i have 400 columns , which is not possible to insert into Open Office Excel , i need to insert other columns into new sheet

Thank You All!!!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

趁微风不噪 2024-08-31 18:06:06

看看这个

Have a look at this.

物价感观 2024-08-31 18:06:06

或者,您可以考虑使用 OleDB 来执行此操作

阅读和使用 ADO.NET 编写 Excel 电子表格

我已经多次使用此方法,发现它既快速又有效。

第三种选择,如果它不必是真正的 xls/xlsx 文件,并且您希望对最终输出的外观进行大量控制,请尝试 Microsoft 的 Spreadsheet XML。

XML 电子表格参考

我再次使用这个方法效果很好

Alternatively you can look at using OleDB to do this

Reading and Writing Excel Spreadsheets Using ADO.NET

I've used this method a number of times and found it to be quick and effective.

3rd Alternative, if it doesn't have to be a true xls/xlsx file and you want lots of control over what the final output looks like, try Microsoft's Spreadsheet XML.

XML Spreadsheet Reference

Again, I've used this method to great effect

话少心凉 2024-08-31 18:06:06

您可以使用 DataSet 从一个源读取数据并更新到另一个源,并具有 2 个不同的 tOleDb 连接。

这是执行此操作的一些代码。

CopyData-SqlToExcel-TwoOledbConnections.cs< /a>

You can read from one source and update to another using DataSet, with 2 distinct tOleDb connections.

Here's some code that does that.

CopyData-SqlToExcel-TwoOledbConnections.cs

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文