⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 someview.aspx.cs

📁 前台首页:users/index.aspx 后台首页:login.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 users_someview : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        int t = Convert.ToInt32(Request.QueryString["id"].ToString());
        SqlConnection con = new SqlConnection("Data source=localhost;uid=sa;pwd=;database=Ebusiness");
        con.Open();
        SqlCommand comm = new SqlCommand("select petname,petmoney,aboutpet,[view],pictrue from product_info where id="+t+"",con);
        SqlDataReader reader = comm.ExecuteReader();
        if(reader.Read())
        {
            petname.Text = reader.GetString(0);
            price.Text = reader.GetSqlMoney(1).ToString();
            aboutpet.Text = reader.GetString(2);
            view.Text = reader.GetString(3);
            Image1.ImageUrl = reader.GetString(4);
            reader.Close();
        }
        con.Close();

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Session["buy"]+= Request.QueryString["id"].ToString()+",";
    }
}

⌨️ 快捷键说明

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