Output Parameter not work with DeleteCommand
Hi all,
I am using Visual Web Developer 2005 XE and SQL Server 2005 XE.
I have two stored procedures as the following:
ALTER PROCEDURE dbo.NganhKinhTeCap1_Delete
@MA varchar(1),
@LOI varchar(20) OUTPUT
AS
BEGIN
SET @LOI = 'ERROR'
END
ALTER PROCEDURE dbo.NganhKinhTeCap1_Update
@MA varchar(1),
@TEN nvarchar(255),
@LOI varchar(20) OUTPUT
AS
BEGIN
SET @LOI = 'ERROR'
END
and my source code in ASPX file:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DIZAGISConnectionString %>"
DeleteCommand="NganhKinhTeCap1_Delete" DeleteCommandType="StoredProcedure" InsertCommand="NganhKinhTeCap1_Insert"
InsertCommandType="StoredProcedure" SelectCommand="SELECT * FROM NGANH_KINHTE_CAP1 WHERE BIKHOA='K'"
UpdateCommand="NganhKinhTeCap1_Update" UpdateCommandType="StoredProcedure">
<DeleteParameters>
<asp:Parameter Name="MA" Type="String" />
<asp:Parameter Direction="InputOutput" Name="LOI" Type="String" DefaultValue="OK" Size=20 />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="MA" Type="String" />
<asp:Parameter Name="TEN" Type="String" />
<asp:Parameter Direction="InputOutput" Name="LOI" Type="String" DefaultValue="OK" Size=20 />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="MA" Type="String" />
<asp:Parameter Name="TEN" Type="String" />
<asp:Parameter Direction="InputOutput" Name="LOI" Type="String" DefaultValue="OK" Size=20 />
</InsertParameters>
</asp:SqlDataSource>
When excuting the Update command, the "LOI" parameter has changed to "ERROR" as expected. But when excuting the Delete command, the "LOI" parameter has not changed, its value is still "OK". Are there any problem with my ASPX code?
What is the problem here?
Anybody can help me?
Thank you very much!
Pham Ha Chung
|