cipher_content.aspx.cs

来自「大家一起研究研究,全部都是开源的CSHARP代码.带数据库的」· CS 代码 · 共 52 行

CS
52
字号
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.OleDb;

public partial class cipher_content : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int procuctId = Convert.ToInt32(Request.QueryString["ProductId"]);
            string sql = "select A.*,B.[ClassId],B.[ClassName] from [NcProducts] As A Left Join [NcClass] B On A.[ProductClassId]=B.[ClassId] where A.[productId]=" + procuctId;
            WebConfig.CreateCon();
            OleDbDataAdapter da = new OleDbDataAdapter(sql, WebConfig.con);
            DataSet ds = new DataSet();
            da.Fill(ds);
            DataTable dt = ds.Tables[0];
            this.Head1.Title = ds.Tables[0].Rows[0]["ProductName"].ToString() + "的详细信息--" + Application["webName"].ToString();
            Label1.Text = dt.Rows[0]["ClassName"].ToString();
            Label2.Text = dt.Rows[0]["productNumber"].ToString();
            Label3.Text = dt.Rows[0]["ProductName"].ToString();
            Label4.Text = dt.Rows[0]["ProductGG"].ToString();
            Label5.Text = dt.Rows[0]["ProductDGG"].ToString();
            Label6.Text = dt.Rows[0]["ProductZGG"].ToString();
            Label7.Text = dt.Rows[0]["ProductIntro"].ToString();
            if (dt.Rows[0]["ProductPic"] != null)
            {
                if(dt.Rows[0]["ProductPic"].ToString() != "")
                    this.Image1.ImageUrl = "upload/"+dt.Rows[0]["ProductPic"].ToString();
                else
                    this.Image1.ImageUrl = "images/no_pic.gif";
            }
            else
            {
                this.Image1.ImageUrl = "images/no_pic.gif";
            }
            Label8.Text = "<a class=\"cBlack\" href=\"Cipher_List_" + dt.Rows[0]["classId"].ToString() + ".aspx\">" + dt.Rows[0]["CLassName"].ToString() +"</a>";
            ds.Dispose();
            da.Dispose();
            WebConfig.CloseCon();
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?