为什么GridView不能调用存储过程去更新?
为什么GridView不能调用存储过程去更新?
提示错误:为过程或函数 指定的参数太多。
<asp:GridView ID= "GridView1 " runat= "server " AutoGenerateColumns= "False " DataKeyNames= "id "
DataSourceID= "SqlDataSource1 ">
<Columns>
<asp:CommandField ShowEditButton= "True " />
<asp:BoundField DataField= "a " HeaderText= "a " SortExpression= "a " />
<asp:BoundField DataField= "b " HeaderText= "b " SortExpression= "b " />
<asp:BoundField DataField= "id " HeaderText= "id " ReadOnly= "True " SortExpression= "id " />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID= "SqlDataSource1 " runat= "server " ConnectionString= " <%$ ConnectionStrings:WCBFConnectionString %> "
DeleteCommand= "DELETE FROM [tt] WHERE [id] = @id " InsertCommand= "INSERT INTO [tt] ([a], [b], [id]) VALUES (@a, @b, @id) "
SelectCommand= "SELECT * FROM [tt] " UpdateCommand= "ttt " UpdateCommandType= "StoredProcedure ">
<DeleteParameters>
<asp:Parameter Name= "id " Type= "String " />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name= "a " Type= "String " />
<asp:Parameter Name= "id " Type= "String " />
</UpdateParameters>