Retriving nvarchar value from stProc
am 04.11.2004 10:32:30 von Neven Klofutar
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")
Re: Retriving nvarchar value from stProc
am 04.11.2004 12:29:55 von Neven Klofutar
Disreguard this, I got it ...
Neven
"Neven Klofutar" wrote in message
news:OG2f5FlwEHA.1264@TK2MSFTNGP12.phx.gbl...
> 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")
>
>
Re: Retriving nvarchar value from stProc
am 04.11.2004 12:55:12 von reb01501
Neven Klofutar wrote:
> 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"
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&thr eadm=O31NZa%230DHA.3436%40tk2msftngp13.phx.gbl&rnum=11&prev= /groups%3Fq%3Ddelimiter%2Bauthor:Bob%2Bauthor:Barrows%26hl%3 Den%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"