为什么不把数据导成csv 格式的就可以呢, EXCEL也可以读它的啊
public static void ExportToFile(HttpResponse response, string fileName, string strContent)
{
response.Clear();
response.ClearHeaders();
response.ClearContent();
response.ContentType = "text/plain;charset=gb2312";
response.AddHeader("content-disposition", string.Format("attachment; filename= {0}", HttpUtility.UrlEncode(fileName)));  response.Output.Write(strContent);
response.End();
}
  上面那个content就是你把dataset已经转化成","隔开的string了, 用上面的response流的方法, 你根本就不需要在服务器上写文件的