日期:2014-05-19  浏览次数:20798 次

GridView导出到Excel的最快方法?
有近万行数据,用哪种方法把GridView导出到Excel最快?


------解决方案--------------------
http://www.cnblogs.com/lovecherry/archive/2005/03/25/125519.html
------解决方案--------------------
从后台数据库导最快。
------解决方案--------------------
Response.ContentType = "application/vnd.ms-excel ";
Response.Charset = " ";
this.EnableViewState = false ;
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new HtmlTextWriter(sw);
this.GridView1.RenderControl(hw);
Response.Write(sw.ToString());
Response.End();