Return Value from SqlCommand in ASP.Net

Discussion in 'ASP .Net' started by Adhik, Jul 19, 2003.

  1. Adhik

    Adhik Guest

    Hi,

    My application has frontend in ASP.Net, middle tier in vb.Net and backend
    SQL Server.

    I have created one function in Middle tier for adding any records by passing
    Procedure Name and Parameters Array.
    Here i am using SQLCommnd Object to Call procedure, to take return value
    i.e. Id or flag of successful insert/update, I have added one
    @retVal as integer as OUTPUT parameter. But if i didn't declare this @retVal
    parameter in Procedure as OTUPUT parameter, then it gives error.

    Before this is ASP and VB as middle tier, I dont need to declare output
    parameter in procedure, just i have to call retrun at end of procedure which
    retrun the reqired value.

    What should i have to do this same to work with ASP.Net.

    Hoping some solution.

    Regards
    Adhik
    Adhik, Jul 19, 2003
    #1
    1. Advertising

  2. In article <eu$>,
    says...
    > Hi,
    >
    > My application has frontend in ASP.Net, middle tier in vb.Net and backend
    > SQL Server.
    >
    > I have created one function in Middle tier for adding any records by passing
    > Procedure Name and Parameters Array.
    > Here i am using SQLCommnd Object to Call procedure, to take return value
    > i.e. Id or flag of successful insert/update, I have added one
    > @retVal as integer as OUTPUT parameter. But if i didn't declare this @retVal
    > parameter in Procedure as OTUPUT parameter, then it gives error.
    >
    > Before this is ASP and VB as middle tier, I dont need to declare output
    > parameter in procedure, just i have to call retrun at end of procedure which
    > retrun the reqired value.
    >
    > What should i have to do this same to work with ASP.Net.


    See:

    "HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET"
    http://support.microsoft.com/default.aspx?scid=kb;en-us;308049

    --
    Patrick Steele
    Microsoft .NET MVP
    http://weblogs.asp.net/psteele
    Patrick Steele [MVP], Jul 19, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Julian Bowes
    Replies:
    0
    Views:
    677
    Julian Bowes
    Jul 1, 2003
  2. =?Utf-8?B?VHJhY2V5?=

    Urgent: I can't update database with SqlCommand

    =?Utf-8?B?VHJhY2V5?=, May 5, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,244
    Alec MacLean
    May 5, 2004
  3. =?Utf-8?B?SklNLkgu?=

    SqlCommand is not defined.

    =?Utf-8?B?SklNLkgu?=, Jul 23, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    5,293
    Jordan
    Jul 23, 2004
  4. Mr Not So Know It All
    Replies:
    4
    Views:
    23,346
    Mr Not So Know It All
    Jan 17, 2006
  5. Greenhorn
    Replies:
    15
    Views:
    810
    Keith Thompson
    Mar 6, 2005
Loading...

Share This Page