M
Mike
This one has me baffled. The proc has one parameter:
CREATE PROCEDURE [dbo].[qDeleteAgencyDetails]
@AgencyID int
AS
BEGIN
SET NOCOUNT ON;
DELETE FROM Agency WHERE AgencyID = @AgencyID
END
I use a dropdownlist to select an option which is displayed in a Formview,
which has an associated SqlDataSource with SELECT/INSERT/UPDATE and DELETE
commands specified. The control parameters for the commands are identical:
<UpdateParameters>
...
<asp:ControlParameter
ControlID="ddlAgencyList"
Name="AgencyID"
PropertyName="SelectedValue"
Type="Int32" />
</UpdateParameters>
<SelectParameters>
<asp:ControlParameter
ControlID="ddlAgencyList"
Name="AgencyID"
PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
<DeleteParameters>
<asp:ControlParameter
ControlID="ddlAgencyList"
Name="AgencyID"
PropertyName="SelectedValue"
Type="Int32" />
<DeleteParameters>
The SELELCT, INSERT and UPDATE work as expected, but the DELETE throws the
exception (in the subject). I've got no code-behind interfering. The whole
thing is wired up declaratively at the moment. The stored proc runs fine
through SSMS. Other pages that follow exactly the same format as this one
(although they deal with different, but similarly structured tables) work
fine in all respects.
There are 20 bonus points for the first person to tell what the obvious
thing I have over looked is![Smile :-) :-)](/styles/default/custom/smilies/smile.gif)
Thanks
Mike
CREATE PROCEDURE [dbo].[qDeleteAgencyDetails]
@AgencyID int
AS
BEGIN
SET NOCOUNT ON;
DELETE FROM Agency WHERE AgencyID = @AgencyID
END
I use a dropdownlist to select an option which is displayed in a Formview,
which has an associated SqlDataSource with SELECT/INSERT/UPDATE and DELETE
commands specified. The control parameters for the commands are identical:
<UpdateParameters>
...
<asp:ControlParameter
ControlID="ddlAgencyList"
Name="AgencyID"
PropertyName="SelectedValue"
Type="Int32" />
</UpdateParameters>
<SelectParameters>
<asp:ControlParameter
ControlID="ddlAgencyList"
Name="AgencyID"
PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
<DeleteParameters>
<asp:ControlParameter
ControlID="ddlAgencyList"
Name="AgencyID"
PropertyName="SelectedValue"
Type="Int32" />
<DeleteParameters>
The SELELCT, INSERT and UPDATE work as expected, but the DELETE throws the
exception (in the subject). I've got no code-behind interfering. The whole
thing is wired up declaratively at the moment. The stored proc runs fine
through SSMS. Other pages that follow exactly the same format as this one
(although they deal with different, but similarly structured tables) work
fine in all respects.
There are 20 bonus points for the first person to tell what the obvious
thing I have over looked is
![Smile :-) :-)](/styles/default/custom/smilies/smile.gif)
Thanks
Mike