昨天搞了一天的gridview(承认比较笨)在gridview中添加新的按钮 执行删除操作 ,必须在相关绑定的 sqldataresource添加 deletecommand属性
如
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
Code
<asp:SqlDataSource ID="studentData" runat="server"
ConnectionString="<%$ ConnectionStrings:studentinfoConnectionString %>"
SelectCommand="SELECT * FROM [Info]"
DeleteCommand="delete from [Info] where number=@number" >
</asp:SqlDataSource>