[求助]在DataList中修改数据的问题
我想在DataList中做数据的修改,在DataList梆定列中放一个Textbox用于显示要修改的数据,HTML代码如下:<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<FONT face="宋体">
<asp:panel id="Panel1" style="Z-INDEX: 101; LEFT: 184px; POSITION: absolute; TOP: 136px" runat="server"
Width="496px" Height="360px">
<asp:DataList id="Repeater1" runat="server" OnUpdateCommand="Repeater1_UpdateCommand">
<HeaderTemplate>
<Table id="Table1" border="2" height="100" width="500">
<tr height="36">
<td>商品名称</td>
<td>价格</td>
<td>数量</td>
<td>交易时间</td>
<td>交易利润</td>
<td>添加利润</td>
</tr>
</HeaderTemplate>
<FooterTemplate>
</Table>
</FooterTemplate>
<ItemTemplate>
<TR height="36">
<TD>
<asp:Label id="lb1" Visible="False" Runat="server">
<%#"kefuguanli.aspx?id="+DataBinder.Eval(Container.DataItem,"bidingdanid")%>
</asp:Label><%#DataBinder.Eval(Container.DataItem, "wupingname" ) %></TD>
<TD><%#DataBinder.Eval(Container.DataItem, "sumnum" ) %></TD>
<TD><%#DataBinder.Eval(Container.DataItem, "number" ) %></TD>
<TD><%#DataBinder.Eval(Container.DataItem, "dingdantime" ) %></TD>
<TD>
<asp:TextBox ID=text1 Runat=server Text='<%#DataBinder.Eval(Container.DataItem, "lirun" )%>'>
</asp:TextBox></TD>
<td>
<asp:LinkButton id="Linkbutton1" Runat="Server" Text="修改!" CommandName="update"></asp:LinkButton></td>
</TR>
</ItemTemplate>
</asp:DataList>
<asp:Label id="Label1" runat="server">Label</asp:Label>
<asp:HyperLink id="HyperLink1" runat="server">上一页</asp:HyperLink>
<asp:HyperLink id="HyperLink2" runat="server">下一页</asp:HyperLink>
</asp:panel><asp:button id="insert" style="Z-INDEX: 102; LEFT: 856px; POSITION: absolute; TOP: 384px" runat="server"
Text="Button"></asp:button></FONT></form>
</body>
在"Repeater1_UpdateCommand"事件中写入的后台代码如下
string bidingdanid=Repeater1.DataKeys[(int)e.Item.ItemIndex].ToString();
TextBox text1=(TextBox)e.Item.FindControl( "text1" );
string strSql1="update bidingdan set lirun='"+text1.Text+"' where bidingdanid='"+bidingdanid+"'";
WebShop.Common1 comm=new WebShop.Common1();
comm.exec(strSql1,CommandType.Text,"bidingdan");
bind();//是梆定方法
在执行中也能执行但是会一直执行直到把梆定的数据全部修改一遍是怎么回事,为什么不是只修改一个啊,希望各位高手帮忙