Results 1 to 3 of 3

Thread: Return Store Procedure

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2002
    Location
    ENGLAND
    Posts
    38

    Return Store Procedure

    Dear All
    I am calling the store procedure from my .net code
    that store procedure return 0 if successfull and
    return 1 if fails
    Please could you tell me how can i return this 0 or 1 to my .NET code
    Many Thanks in advance
    salih
    sa

  2. #2
    Hyperactive Member
    Join Date
    Jan 2003
    Location
    Cape Cod, US
    Posts
    292
    You need to add a return value paramater to your parameter collection.

    I think it also has to be the 1st one.

    Something like:

    Code:
            Dim myParm As SqlClient.SqlParameter
    
            myParm = myCmd.Parameters.Add("RETURN_VALUE", SqlDbType.Int)
            myParm.Direction = ParameterDirection.ReturnValue

  3. #3
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    I think it also has to be the 1st one.
    No, it doesn't have to be the first parameter in the collection. I usually put my return value as the last one in the collection. You can put it anywhere, but it is better practice to put it as the first or last in the collection.

Posting Permissions

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



Click Here to Expand Forum to Full Width