求dataGridView导出数据到Execl 求dataGridView导出数据到Execl 最快的方法最常见的是遍历导出!!!请问有没有别的 更快速 导出更多数据的方法? 最好一次性的那种!!谢谢了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void Download(Control ctl) { HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=details.xls"); HttpContext.Current.Response.Charset = "UTF-8"; HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.Default; HttpContext.Current.Response.ContentType = "application/ms-excel"; ctl.Page.EnableViewState = true; System.IO.StringWriter tw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw); ctl.RenderControl(hw); HttpContext.Current.Response.Write(tw.ToString()); HttpContext.Current.Response.End(); }参数传入控件 将数据表导出即可。遍历表内容,再用XMLWRITER写入到文件中 孟子E章 前辈的。服务器不用安装 office http://dotnet.aspx.cc/file/Export-Gridview-To-Excel-With-Multi-Sheet.aspx忘记发链接了。囧 .net 与 java 的byte互通 求思路,有代码更好! 诡异的C#程序 从textbox中提取多个数字 使用c#生成复杂PDF的可行性? 强签名的密码有什么用? 求一正则表达式 WINFORM的DATAGRID能否响应双击所选择行时的事件??如果可以应该在哪里写?怎么写??急~~~~~~~ 请教高手一个数据绑定的问题! 端口的访问被拒绝的问题 C#编写的服务程序启动服务时报错误1053 安装程序包时出现错误1001,这是怎么回事?
{
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=details.xls"); HttpContext.Current.Response.Charset = "UTF-8"; HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.Default; HttpContext.Current.Response.ContentType = "application/ms-excel"; ctl.Page.EnableViewState = true; System.IO.StringWriter tw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw); ctl.RenderControl(hw); HttpContext.Current.Response.Write(tw.ToString()); HttpContext.Current.Response.End();
}参数传入控件
孟子E章 前辈的。
服务器不用安装 office
忘记发链接了。囧