I'm a little confused as to how the SqlDataSource works with its
DeleteParameters. I have a GridView hooked up to my SqlDataSource.
Here is my templatefield with my Delete button :
<asp:TemplateField HeaderText="Select">
<ItemTemplate>
<asp:LinkButton ID="DeleteButton"
CommandArgument='<%# Eval("ForecastKey") %>'
CommandName="Delete" runat="server">
Delete</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
And here is my SqlDataSource :
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:XeroxConnectionString %>"
SelectCommand="ViewForecast" SelectCommandType="StoredProcedure"
DeleteCommand="DeleteForecast" DeleteCommandType="StoredProcedure">
</asp:SqlDataSource>
My stored procedure requires 1 parameter (ForecastKey) to be passed to
it, but I can get away with not specifying DeleteParameters in my
SqlDataSource and it still deletes the record. Any ideas why it does
this, and whether this method of not specifying parameters is a
recommended way to do this?
*** Sent via Developersdex http://www.developersdex.com ***