我有一个3列的Gridview(公司名称,卷,计数器)我想计数器栏是所有按钮,当用户点击按钮时,它将计数器加1。不知道如何正确设置更新命令。以下是我迄今为止:ASP.NET Gridview按钮
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1"
EmptyDataText="There are no data records to display.">
<Columns>
<asp:BoundField DataField="CompanyName" HeaderText="CompanyName"
SortExpression="CompanyName" />
<asp:BoundField DataField="Volume" HeaderText="Volume"
SortExpression="Volume" />
<asp:ButtonField DataTextField="counter" HeaderText="counter"
ButtonType="button"/>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:LiquorStoreConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:LiquorStoreConnectionString1.ProviderName %>"
SelectCommand="SELECT [CompanyName], [Volume], [counter] FROM [Company]">
</asp:SqlDataSource>
所有我需要做的是1每次按下按钮对特定行时间递增。
我编辑了你的标题。请参阅:“[应该在其标题中包含”标签“](http://meta.stackexchange.com/questions/19190/)”,其中的共识是“不,他们不应该”。 –
谢谢约翰!我很抱歉这样做,我会读你的链接,你已经提供:) – vadim