?? querybooksoverprint.aspx.cs
字號:
?//文件名:QueryBooksOverPrint.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class QueryManage_QueryBooksOverPrint : System.Web.UI.Page
{
private QueryManage_QueryBooksOverForm MyPrintForm;
protected void Page_Load(object sender, EventArgs e)
{//將查詢結果輸出到Excel文件中
MyPrintForm = (QueryManage_QueryBooksOverForm)Context.Handler;
string MySQL = MyPrintForm.MyPrintSQL;
this.Label1.Text = Session["MyCompanyName"].ToString() + "圖書館超期未還圖書統計表";
this.Label2.Text = MyPrintForm.MyPrintDate;
string MyConnectionString = ConfigurationManager.ConnectionStrings["MyBooksDBConnectionString"].ConnectionString; ;
SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnectionString);
DataSet MySet = new DataSet();
MyAdapter.Fill(MySet);
this.DataGrid1.DataSource = MySet;
this.DataGrid1.DataBind();
this.Response.ContentType = "application/vnd.ms-excel";
this.Response.Charset = "";
this.EnableViewState = false;
System.IO.StringWriter MyWriter;
System.Web.UI.HtmlTextWriter MyWeb;
MyWriter = new System.IO.StringWriter();
MyWeb = new System.Web.UI.HtmlTextWriter(MyWriter);
this.DataGrid1.RenderControl(MyWeb);
Response.Write(MyWriter.ToString());
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -