<asp:AccessDataSource ID="productsubtype" Runat="server" DataFile="~/access_db/db_tables.mdb"
SelectCommand="SELECT [type], [id],[subtype] FROM [prod_subtype]"
UpdateCommand="UPDATE [prod_subtype] SET [subtype]=@subtype WHERE [id]=@id"
DeleteCommand="DELETE FROM [prod_subtype] WHERE [id]=@id"
FilterExpression="type='{0}'">
<UpdateParameters>
<asp:Parameter Name="subtype" Type="string" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="id" Type="string" />
</DeleteParameters>
<FilterParameters>
<asp:ControlParameter Name="type" DefaultValue="-1"
Type="String" ControlID="gdproducttype"
PropertyName="SelectedValue"></asp:ControlParameter>
</FilterParameters>
</asp:AccessDataSource>
当我在gridview中按删除按钮时,我收到错误
答案 0 :(得分:0)
尝试将UpdateParameters更改为以下内容:
<UpdateParameters>
<asp:Parameter Name="id" Type="string" />
<asp:Parameter Name="subtype" Type="string" />
</UpdateParameters>