SqlDataSource DeleteParameters

M

Mike P

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top