You are here: Re: PLEASE PLEASE HELP - How can I get a return value from a SQL Stored Proc is ASP.NET? « MsSQL Server « IT news, forums, messages
Re: PLEASE PLEASE HELP - How can I get a return value from a SQL Stored Proc is ASP.NET?

Posted by jbonifacejr on 11/30/06 19:59

Thank you for your help. Any chance you have a moment to help just a
little more? Here is what I did, but I still can't access the value
output by the stored proc...

I removed the Return @sRetUPC line. I am guessing that I can rely on
the set @sRetUPC line to set the value of the output parameter

>From there, I appended the parameters in the ASP code...like this
oSproc.Parameters.Append(oParam2)
oSproc.Parameters.Append(oParam1)
--originally I tried to do Param1 then Param2, but I got an error
about the parameter
--type being an output, so I just figured I had them in the wrong
order because the
--first parameter in the code was the output one.

Then, I added the line oSproc.Execute()
After that is:
Dim res
res = oSproc.Parameters.Item("sRetUPC").Value.toString()

This is not working. Do you know how I can get access to the value of
the parameter that is returned?


> Just a few pointers here:
> - creating a parameter will just create a parameter. To use it, you need
> to add it to the command object using oSProc.Parameters.Append
> - in a stored procedure you can only use the RETURN keyword to return an
> integer, so @sRetUPC is out of the question
> - if you want to use the value of the output parameter, then you should
> access it through the Parameters collection of the Command object. The
> syntax you are currently using refers to the resultset, but the stored
> procedure does not have one
>
> HTH,
> Gert-Jan

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация