2011年2月21日

摘要: 1,用数据库字段实现之美好字段: 下图中红色箭头是属于父类: ID 父ID 类型名称 深度 排序 深度字段是用来查询某一分类的所有子类。 跟windows文件目录管理思想一致。 类似: 在做考题的的时候,涉及到分类,虽然不是无限级的,但是,为了以后扩展用,想做成无限级,在网上找找了,一个用存储过程作的,虽然添加,编辑,移动,用的是存储过程,可是在读出来的时候只用了一条Select 语句,感觉挺爽的... 阅读全文
posted @ 2011-02-21 18:46 Henry_Wang 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 1,购物车实现: 页面: 代码: 数据: 购物车数据可以保存在Profile中,Profile跟Session类似,不过Profile是强类型。 a,配置Profile ,只能在网站根目录或者machine.config中定义Profile,一个应用程序中无法定义两个以上的Profile。 <configuration> <System.web> <prof... 阅读全文
posted @ 2011-02-21 15:44 Henry_Wang 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 1,Profile实现: 方式1: 数据主要存储在SqlServer自定义表中。 其中获得用户名方式:HttpContext.Current.User.Identity.Name profile.cartManager b,数据存储在Profile中 2,cookie实现 阅读全文
posted @ 2011-02-21 15:43 Henry_Wang 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 数据控制: SqlConnection conn = db.GetConnection();SqlTransaction trans = conn.BeginTransaction(); foreach(CartInfo cartItem in cartItems) { insertSp[1].Value=cartItem.bookid; insertSp[2].Value=cartItem.p... 阅读全文
posted @ 2011-02-21 15:43 Henry_Wang 阅读(126) 评论(0) 推荐(0) 编辑

导航