[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

11/05/2009 at 03:55PM PST, ID: 24876592 | Points: 20
[x]
Attachment Details

How can I get return value from Store Procedure within SqlDataSource in ASP.net

Asked by bqaits in Microsoft Visual C#.Net, .NET Framework 3.x versions

Tags: C# ASP.NET

Hi I am new to this.
I don't get any value back when I execute my code.but when I execute the SP I can get the value 47.
Please help.
Thanks in advance.
The following is detail
        <asp:SqlDataSource ID="SqlDataSource2" runat="server"
            ConnectionString="<%$ ConnectionStrings:EDIConnectionString %>"
            OnSelecting="SqlDataSource2_Selecting"
            SelectCommand="FailedCreateSO" SelectCommandType="StoredProcedure" >
            <SelectParameters>
                <asp:Parameter DefaultValue="0" Direction="InputOutput" Name="NOOfFAILEDTRX"
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>

SP

CREATE PROCEDURE FailedCreateSO @NOOfFAILEDTRX INT OUTPUT
as

SELECT @NOOfFAILEDTRX = COUNT(*)  FROM EDITRX850_IN WHERE (Status = 'E') AND (TransferToOracleDate > GETDATE() - 200)
GO

Code
        protected void SqlDataSource2_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
        {

            int test;
            test = (int)e.Command.Parameters["@NOOfFAILEDTRX"].Value
           
        }
 
Keywords: How can I get return value from Store …
 
Loading Advertisement...
 
[+][-]11/06/09 04:07 AM, ID: 25758379

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_3_20080625