当我运行此代码时,我得到代码,我得到错误必须声明标量变量。如果我只使用Vendor并删除删除参数,它可以正常工作,但仅适用于Vendor。删除过程正在使用自动生成列但删除按钮的GridView。我做错了什么?
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="DeleteBtn" runat="server" CommandName="Delete"
OnClientClick="return isDelete();">Delete
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:TestAdamConnectionString %>" SelectCommand="SELECT * FROM [TestRedo]" OnSelecting="SqlDataSource2_Selecting"
DeleteCommand="DELETE FROM [TestRedo] WHERE [Vendor] = @Vendor AND [Expiration] = @Expiration AND [ActionReq] = @ActionReq">
<DeleteParameters>
<asp:Parameter Name="Expiration" />
<asp:Parameter Name="ActionReq"/>
</DeleteParameters>
</asp:SqlDataSource>