请问一下 我要删除购物车里的数据要怎么写啊
单纯删除业务 不改变数据库
请高人指点一下
单纯删除业务 不改变数据库
请高人指点一下
解决方案 »
- 连接数据库问题
- 求助微软owa 2010换登录页面 求助求助急。求高手。。。
- web.config里面存用户名和密码.在页面中取得
- 用XmlTextReader远程读取XML数据的问题~!
- ajax急速狂彪:开发99收藏夹体会(一)及正式发布
- <%# if (DataGrid1.CurrentPageIndex * DataGrid1.PageSize + Container.ItemIndex)="0" %> 这样写法错误,要怎么写才正确啊!!!
- 关于Inherits的问题
- 网站上下链接的问题.无法分类调用
- Newtonsoft解析json
- 安装树的问题??????????
- 寻找物资采供管理系统的高手实现物资上月库存+收入-发出 =本月收入的算法?物资收发存报表
- 验证(CSS 2.0): fmargin 不是已知的 CSS 属性名
如果是session的话就把数据保存在List<>里面,进行操作
{
List<Amodel> l = new List<Amodel>();
if (Session["name"] != null)
{
l = (List<Amodel>)Session["name"];
} if (Request.QueryString["id"] != null)
{
aBLL ab = new aBLL();
Amodel a = ab.GetTable(Convert.ToInt32(Request.QueryString["id"])); l.Add(a);
Session["name"] = l;
}
Rpt.DataSource = l;
Rpt.DataBind();
int sum = 0;
foreach (Amodel am in l)
{
sum += am.IPrice;
}
Label2.Text ="总价"+ sum();
}
datatable dt=(datatable)session[]
dt.删除某一行
我用producteSort类写了一下
根据ID进行删除
List<ProducteSort> list = null
if (Session["name"] != null)
{
list = (list<ProducteSort>)Session["name"];
} if (Request.QueryString["id"] != null)
{
for (int i = 0; i < list.Count; i++)
{
ProducteSort producte = list[i];
if (producte.ID.ToString() == Request.QueryString["id"].ToString())
{
list.Remove(producte);
}
}
}