DataTable tb = SelectData("3");
if (thisTable != null)
{
StringWriter sw = new StringWriter(); sw.WriteLine("编号\t帐号\t姓名\t电话\t地址\t金额\t开通时间"); foreach (DataRow dr in tb.Rows)
{
sw.WriteLine(dr["cooperationNum"] + "\t" + dr["cooperationTheme"] + "\t" + dr["creater"] + "\t" + dr["createTime"]
+ "\t" + dr["cooperationName"] + "\t" + dr["cooperationSubmitStateName"] + "\t" + dr["cooperationID"]);
} sw.Close(); Response.AddHeader("Content-Disposition", "attachment; filename=YinHeUserInfo.xls"); Response.ContentType = "application/ms-excel"; Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); Response.Write(sw); Response.End();
}
if (thisTable != null)
{
StringWriter sw = new StringWriter(); sw.WriteLine("编号\t帐号\t姓名\t电话\t地址\t金额\t开通时间"); foreach (DataRow dr in tb.Rows)
{
sw.WriteLine(dr["cooperationNum"] + "\t" + dr["cooperationTheme"] + "\t" + dr["creater"] + "\t" + dr["createTime"]
+ "\t" + dr["cooperationName"] + "\t" + dr["cooperationSubmitStateName"] + "\t" + dr["cooperationID"]);
} sw.Close(); Response.AddHeader("Content-Disposition", "attachment; filename=YinHeUserInfo.xls"); Response.ContentType = "application/ms-excel"; Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); Response.Write(sw); Response.End();
}