注册商品
来源:互联网 发布:vb循环语句do while 编辑:程序博客网 时间:2024/04/30 23:39
注册商品的前台:
后台: public partial class NewProduct : System.Web.UI.Page { // 添加商品 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SqlHelper s = new SqlHelper(); string cmtext = "select * from T_GoodsType"; DataTable dt = s.GetTable(cmtext, null, CommandType.Text); DropDownList1.DataSource = dt; DropDownList1.DataTextField = "TypeName"; DropDownList1.DataValueField = "TypeID"; DropDownList1.DataBind(); } } protected void Button1_Click(object sender, EventArgs e) { int typeid = int.Parse(DropDownList1.SelectedValue); string goodname = GoodName.Text.Trim(); string goodprice = GoodPrice.Text.Trim(); SqlHelper s = new SqlHelper(); string cmtext = "insert into T_GoodsInfo(TypeID,GoodsName,GoodsPrice)values(@typeid,@goodname,@goodprice)"; SqlParameter[] paras ={ new SqlParameter ("typeid",SqlDbType.Int), new SqlParameter ("@goodname",SqlDbType.VarChar), new SqlParameter ("@goodprice",SqlDbType.Float) }; paras[0].Value = typeid; paras[1].Value = goodname; paras[2].Value = goodprice; int result = s.ExecuteNoQuery(cmtext, paras, CommandType.Text); if (result > 0) { Response.Write(""); } else Response.Write(""); }
- 注册商品
- 登陆注册,商品
- Andriodjie——登陆注册展示商品
- ui路由---实际案例操作(首页 登录 注册 商品列表)
- 商品
- 商品搜索引擎--商品推荐
- 注册
- 注册
- 注册
- 注册
- 注册
- 注册
- 注册
- 注册
- 注册
- 注册
- 注册
- 注册
- 遥感理论知识(二)
- 关键字volatile
- pku3639 Exchange Rates (动态规划)
- php中$_SERVER参数HTTP_X_FORWARDED_FOR & REMOTE_ADDR与获取IP
- November, 09
- 注册商品
- 下面继续Flex开发
- 1632 Sumsets【转】
- [双语阅读]婴儿哭声藏玄机 声调不同因在母语
- 求书
- [双语阅读]“欧洲百万”开奖 英两幸运儿平分1亿大奖
- 转帖
- 第10章 内部类
- 基于LRU算法的Java对象池设计