Professional Web Applications Themes

Retriving nvarchar value from stProc - ASP Database

Hi, I have a problem retriving scalar nvarchar value from stProc in MS SQL Server ... Please tell me what am I doing wrong ... thanx, Neven ************************* CREATE PROCEDURE someUser.GetFirstCourse strEducationName nvarchar(50) AS DECLARE strCourseName nvarchar(50) SET strCourseName = (SELECT course FROM tblEducation WHERE name = strEducationName) Return strCourseName GO **************************** ASP code ... cmComm.CommandText = "GetFirstCourse" cmComm.CommandType = adCmdStoredProc cmComm.ActiveConnection = cnConn cmComm.Parameters.Append cmComm.CreateParameter ("RETURN_VALUE", adVarWChar, adParamReturnValue, 50) cmComm.Parameters.Append cmComm.CreateParameter ("strEducationName", adVarWChar, adParamInput, 50) cmComm.Parameters("strEducationName") = strEducationName cmComm.Execute strCourseName = cmComm.Parameters("RETURN_VALUE")...

  1. #1

    Default Retriving nvarchar value from stProc

    Hi,

    I have a problem retriving scalar nvarchar value from stProc in MS SQL
    Server ...
    Please tell me what am I doing wrong ...

    thanx, Neven


    *************************
    CREATE PROCEDURE someUser.GetFirstCourse
    strEducationName nvarchar(50)
    AS

    DECLARE strCourseName nvarchar(50)

    SET strCourseName = (SELECT course FROM tblEducation WHERE name =
    strEducationName)
    Return strCourseName
    GO
    ****************************
    ASP code ...


    cmComm.CommandText = "GetFirstCourse"
    cmComm.CommandType = adCmdStoredProc
    cmComm.ActiveConnection = cnConn

    cmComm.Parameters.Append cmComm.CreateParameter ("RETURN_VALUE", adVarWChar,
    adParamReturnValue, 50)
    cmComm.Parameters.Append cmComm.CreateParameter ("strEducationName",
    adVarWChar, adParamInput, 50)
    cmComm.Parameters("strEducationName") = strEducationName

    cmComm.Execute
    strCourseName = cmComm.Parameters("RETURN_VALUE")


    Neven Guest

  2. #2

    Default Re: Retriving nvarchar value from stProc

    Disreguard this, I got it ...

    Neven


    "Neven Klofutar" <neven.klofutar*r.e..mo.v.e*vip.hr> wrote in message
    news:phx.gbl... 
    adVarWChar, 


    Neven Guest

  3. #3

    Default Re: Retriving nvarchar value from stProc

    Neven Klofutar wrote: 

    I know you say that you "got it", but if you're still around, please
    consider this:
    http://tinyurl.com/jyy0


    http://www.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=O31NZa%230DHA.3436%40tk2msftngp13.phx.gb l&rnum=11&prev=/groups%3Fq%3Ddelimiter%2Bauthor:Bob%2Bauthor:Barro ws%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26start%3D10%26sa%3DN

    You don't need to use the Command object here.

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Guest

Similar Threads

  1. Retriving data from DB
    By Neven in forum ASP Database
    Replies: 16
    Last Post: October 31st, 03:18 AM
  2. Adding numbers from a nvarchar field
    By JayG in forum ASP Database
    Replies: 4
    Last Post: January 22nd, 02:39 PM
  3. Which ADO constant for SQL server NVarchar type?
    By Iain in forum ASP Database
    Replies: 1
    Last Post: November 18th, 12:08 AM
  4. nvarchar Question
    By Don Grover in forum ASP
    Replies: 1
    Last Post: October 11th, 01:07 PM
  5. Access - retriving primary key ...
    By Neven Klofutar in forum ASP Database
    Replies: 1
    Last Post: July 21st, 10:40 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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