?? buildingprint.aspx.cs
字號:
?//文件名:BuildingPrint.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 BaseManage_BuildingPrint : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{//打印小區樓棟信息
string MySQL = "Select * From 樓棟信息 ";
this.Label1.Text = Session["MyCommunityName"].ToString() + "樓棟信息統計表";
this.Label2.Text = "打印時間:"+DateTime.Now.ToShortDateString();
string MyConnectionString = ConfigurationManager.ConnectionStrings["MyCommunityDBConnectionString"].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 + -