?? interestbook.aspx.cs
字號:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace Library_BS
{
/// <summary>
/// InterestBook 的摘要說明。
/// </summary>
public class InterestBook : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Panel Panel1;
protected System.Web.UI.WebControls.Label BarCode;
protected System.Web.UI.WebControls.Label lblRegisterName;
protected System.Web.UI.WebControls.DataGrid DataGrid1;
protected System.Web.UI.WebControls.Panel Panel2;
private void Page_Load(object sender, System.EventArgs e)
{
this.lblRegisterName.Text=Request["RegistName"];
this.BarCode.Text=Request["barcode"];
string connStr="server=\'(local)\'; trusted_connection=true; database=\'Library\'";
SqlConnection myConnection=new SqlConnection(connStr);
myConnection.Open();
//string w=Request["namei"].ToString();
string queryStr="select BookName as 書名,Author as 作者,IndexID as 索引號,Publisher as 出版社,PageNum as 頁碼,Price as 價格 from InterestBook where UserBarCode='"+BarCode.Text+"'";
SqlDataAdapter myDataAdapter=new SqlDataAdapter(queryStr,myConnection);
DataSet myDataSet=new DataSet();
myDataAdapter.Fill(myDataSet,"InterestBook");
// if (myDataSet.Tables["1"].Rows.Count>0)
//{
//Label3.Text="所有借的圖書現(xiàn)在歷史信息:";
DataGrid1.DataSource=myDataSet.Tables["InterestBook"].DefaultView;
DataGrid1.DataBind();
// 在此處放置用戶代碼以初始化頁面
//}
}
#region Web 窗體設計器生成的代碼
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 該調(diào)用是 ASP.NET Web 窗體設計器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內(nèi)容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -