Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > Visual Web Developer 2005
|
Visual Web Developer 2005 Discuss creating ASP.NET 2.0 sites with Microsoft's Visual Web Developer 2005. If your question is more specific to a piece of code than the Visual tool, see the ASP.NEt 2.0 forums instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Web Developer 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 2nd, 2006, 10:22 PM
Registered User
 
Join Date: Oct 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Capturing Output Parameter Value GailCG SQL Server 2005 1 November 19th, 2008 08:52 AM
output parameter SKhna ASP.NET 2.0 Basics 3 February 25th, 2008 10:58 AM
SqlDbType.Xml Output Parameter needs a size - Why? francislang ADO.NET 1 January 28th, 2008 08:28 PM
Output parameter sybase C# goser C# 2005 2 October 24th, 2007 03:17 AM
How to return an output parameter dyaneshwaran SQL Language 0 January 12th, 2006 05:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.