Return Value from SqlCommand in ASP.Net

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Return Value from SqlCommand in ASP.Net

    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 Guest

  2. Similar Questions and Discussions

    1. Retrieve result from SqlCommand
      Dear developer, I'm developing a web service with VS .NET and using C#. And part of the webservice is to get data from database (by using...
    2. SqlConnection, SqlCommand
      I'm trying to understand SqlConnection(), SqlCommand() For example. I use SqlConnection() as a parameter when I create a new SqlCommand. Then I...
    3. return xml
      The following function is used in my webservice which returns a dataset. I now need to return the dataset as xml and have no idea how to do it....
    4. goToNetPage, return or not return
      hi, I have read in the director's help the netDone() command indicates whether a background loading operation (such as getNetText,...
    5. "Internal connection fatal error" when calling SQLCommand.ExecuteReader
      We are getting this error intermittently (about 5-10 times an hour) from one of our applications. It is not restricted to any particular page or...
  3. #2

    Default Re: Return Value from SqlCommand in ASP.Net

    In article <eu$6JedTDHA.1556@TK2MSFTNGP10.phx.gbl>, [email]adhik@hotpop.com[/email]
    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"
    [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;308049[/url]

    --
    Patrick Steele
    Microsoft .NET MVP
    [url]http://weblogs.asp.net/psteele[/url]
    Patrick Steele [MVP] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139