我爱Aspx >> Asp.Net >> 数据岛出到Excel最为简易的方法只需将ContentType 设置为 "application/vnd.ms-excel",表示以Excel方式输出.
代码如下:
DataToExcel.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DataToExcel.aspx.cs" Inherits="DataToExcel" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>DataToExcel</title>
</head>
<body>
<form id="form1" runat="server">
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</form>
</body>
</html>DataToExcel.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
Ҷƪл˵?
一些常用的数据操作类[08-01]
做个DataList 可分页的数据源[08-01]
通过预处理器指令调整连接的数据..[08-01]
Oracle:一条SQL实现将多行数据并..[08-01]
在虚拟主机中用ASP.NET1.1服务器..[08-01]
用asp.net还原与恢复sqlserver数..[08-01]
ASP 2.0 数据绑定函数Eval()的机..[08-01]
ASP.NET数据库编程之处理文件访问..[08-01]
数据库死锁导致网站站点访问不了..[08-01]
在ASP.net中保存/取出图片入/从S..[08-01]
Flash特效动画制作:飞舞的螺炫[08-01]
Photoshop鼠绘迪士尼经典卡通角色..[08-01]
找到适合Win2000的系统配置程序[08-01]
端口·木马·安全·扫描应用知识[08-01]
Excel中巧用样式列表快速实现文本..[08-01]
一些常用的数据操作类[08-01]
做个DataList 可分页的数据源[08-01]
通过预处理器指令调整连接的数据..[08-01]
Photoshop打造超精美炫光飞镖[08-01]
各种邮箱垃圾邮件自动删除的方法[08-01]