从gridview中的id = @id的表中删除给出错误

时间:2016-06-20 20:04:15

标签: c# asp.net gridview

我正在尝试删除gridview中所选行的数据,但我收到的错误是这样的

  

“必须声明标量变量”@ModelID“。”

这是我的sqldataadapter代码

 <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString='<%$ ConnectionStrings:myconnectionstring %>' SelectCommand="SELECT * FROM [ChannelsDataValidation] WHERE ([ModelID] = @ModelID)" DeleteCommand="DELETE FROM ChannelsDataValidation WHERE (ModelID = @ModelID)" UpdateCommand="UPDATE ChannelsDataValidation SET ChannelNumber = @ChannelNumber, DataType = @DataType, MinValue = @MinValue, MaxValue = @MaxValue, Unit = @Unit, Name = @Name WHERE (ModelID = @ModelID)">
    <DeleteParameters>
        <asp:Parameter Name="ModelID"></asp:Parameter>
    </DeleteParameters>

0 个答案:

没有答案