?? show.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 醫(yī)院管理系統(tǒng)
{
/// <summary>
/// show 的摘要說明。
/// </summary>
public class show : System.Web.UI.Page
{
protected System.Data.SqlClient.SqlConnection cnn;
protected System.Data.SqlClient.SqlCommand cmd;
private void Page_Load(object sender, System.EventArgs e)
{
if(cnn.State==0) cnn.Open();
this.Response.ContentType="image/*";
cmd.Parameters["@ids"].Value =Convert.ToInt32(Request.QueryString["ImageID"]);
SqlDataReader dr=cmd.ExecuteReader();
while(dr.Read())
{
this.Response.BinaryWrite((byte[])dr["myimdata"]);
}
dr.Close();
cnn.Close();
}
#region Web 窗體設(shè)計器生成的代碼
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 該調(diào)用是 ASP.NET Web 窗體設(shè)計器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 設(shè)計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內(nèi)容。
/// </summary>
private void InitializeComponent()
{
this.cnn = new System.Data.SqlClient.SqlConnection();
this.cmd = new System.Data.SqlClient.SqlCommand();
//
// cnn
//
this.cnn.ConnectionString = "workstation id=\"802-HUANGHAI\";packet size=4096;integrated security=SSPI;data sour" +
"ce=\".\";persist security info=False;initial catalog=醫(yī)院管理系統(tǒng)";
//
// cmd
//
this.cmd.CommandText = "[myimsel1]";
this.cmd.CommandType = System.Data.CommandType.StoredProcedure;
this.cmd.Connection = this.cnn;
this.cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
this.cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ids", System.Data.SqlDbType.Int, 4));
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -