mysc.aspx.cs
(完整代码) 1KBusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
namespace 电子商务
{
public partial class mysc : System.Web.UI.Page
{
SQLHelper db = new SQLHelper();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bind();
}
}
//
//
public void bind()
{
int hy_id = int.Parse(Session["hy_id"].ToString());
string sql = "select * from sc where hy_id="+hy_id;
DataTable dt = db.ExecuteQuery(sql, CommandType.Text);
this.gv.DataSource = dt;
this.gv.DataBind();
}
//后台绑定前台代码,根据产品ID显示产品名称
public string bind_pro(int id)
{
string s;
string sql = "select * from product where pro_id=" + id;
DataTable dt = db.ExecuteQuery(sql, CommandType.Text);
s = dt.Rows[0]["name"].ToString();
return s;
}
protected void gv_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int id = Convert.ToInt32(this.gv.DataKeys[e.RowIndex].Value.ToString());
string sql = "delete from sc where sc_id="+id;
db.ExecuteNonQuery(sql, CommandType.Text);
bind();
}
//
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。