62,270
社区成员
发帖
与我相关
我的任务
分享
string sLH = HttpUtility.UrlDecode(context.Request["lh"], utf8);
string sql = "select partno,partname,partspec,unit,whno,qty from vmi_stock where 1=1";
if (!string.IsNullOrEmpty(sLH)) sql += " and partno like '%" + sLH + "%'";
DataTable dt = DBConnOracle.GetDataTable(AppConfiguration.EPOOracle, sql);
//OperateExcel.ExportExcel(HttpContext.Current.Response, dt, "kk.xlsx");
MemoryStream ms = new MemoryStream();
BinaryFormatter b = new BinaryFormatter();
b.Serialize(ms, dt);
ms.Close();
byte[] buff = ms.GetBuffer();
//context.Response.OutputStream.Write(buff, 0, buff.Length);
context.Response.Write(buff);
//HttpContext.Current.Response.Write(buff);
HttpContext.Current.ApplicationInstance.CompleteRequest();
//context.Response.End();
这个问题困扰我很久了……