Asp.net源码专业站
首页->商务办公->固定资产管理系统源码>>DepreciationManage/QueryDepreciationPrint.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:固定资产管理系统源码
当前文件:文件类型 DepreciationManage/DepreciationManage/QueryDepreciationPrint.aspx.cs[1K,2009-6-12 11:38:44]打开代码结构图
普通视图
		            
1//文件名:QueryDepreciationPrint.aspx.cs 2using System; 3using System.Data; 4using System.Configuration; 5using System.Collections; 6using System.Web; 7using System.Web.Security; 8using System.Web.UI; 9using System.Web.UI.WebControls; 10using System.Web.UI.WebControls.WebParts; 11using System.Web.UI.HtmlControls; 12 13using System.Data.SqlClient; 14public partial class DepreciationManage_QueryDepreciationPrint : System.Web.UI.Page 15{ 16 private DepreciationManage_QueryDepreciationForm MyQueryForm; 17 protected void Page_Load(object sender, EventArgs e) 18 {//将查询结果输出到Excel文件中 19 MyQueryForm = (DepreciationManage_QueryDepreciationForm)Context.Handler; 20 string MySQL = MyQueryForm.MyPrintSQL; 21 this.Label1.Text = MyQueryForm.MyPrintTitle; 22 this.Label2.Text = MyQueryForm.MyPrintDate ; 23 string MyConnectionString = ConfigurationManager.ConnectionStrings["MyAssetsDBConnectionString"].ConnectionString; ; 24 SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnectionString); 25 DataSet MySet = new DataSet(); 26 MyAdapter.Fill(MySet); 27 this.DataGrid1.DataSource = MySet; 28 this.DataGrid1.DataBind(); 29 this.Response.ContentType = "application/vnd.ms-excel"; 30 this.Response.Charset = ""; 31 //关闭 ViewState 32 this.EnableViewState = false; 33 System.IO.StringWriter MyWriter; 34 System.Web.UI.HtmlTextWriter MyWeb; 35 //将信息写入字符串 36 MyWriter = new System.IO.StringWriter(); 37 //在Web窗体页上写出一系列连续的HTML特定字符和文本 38 MyWeb = new System.Web.UI.HtmlTextWriter(MyWriter); 39 //将DataGrid中的内容输出到HtmlTextWriter对象中 40 this.DataGrid1.RenderControl(MyWeb); 41 //把HTML写回浏览器 42 Response.Write(MyWriter.ToString()); 43 } 44} 45
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:固定资产管理系统源码
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146