日期:2014-05-17  浏览次数:20447 次

提交表单后,如何对一个表格中的多条记录分别进行数据处理?


提交订单后,在库存表中把订单中的每种商品数量减去,所以像这种一次提交多条记录不知道该怎么处理

------解决方案--------------------
页面代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ghypnus.bs.test._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form2" runat="server">
  <asp:Repeater ID="Repeater1" runat="server">
  <HeaderTemplate>
    <table cellpadding="3" cellspacing="3">
        <tr>
            <td>ID</td><td>COUNT</td><td>PRICE</td>
        </tr>
    </table>
  </HeaderTemplate>
            <ItemTemplate>
            <table cellpadding="13" cellspacing="13">
                <tr>
                    <td><asp:Label ID="lbl_ID" runat="Server" Text='<%#Eval("ID") %>'></asp:Label></td>
                    <td><asp:Label ID="lbl_COUNT" runat="Server" Text='<%#Eval("Count") %>'></asp:Label></td>
                    <td><asp:Label ID="Lbl_PRICE" runat="Server" Text='<%#Eval("Price") %>'></asp:Label></td>
                </tr>
            </table>
            </ItemTemplate>
        </asp:Repeater>
    </form>
</body>
</html>

后台测试数据:
 protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            DataColumn dc = null;
      &nb