Re: SQL functions

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I beleive the return var type is the problem.

it only can return one var and has to be integer. (sybase help)

"Ron Allen" wrote:

> raulavi,
> You will have to declare another parameter in your SqlCommand with a
> Direction of ParameterDirection.ReturnValue and use this to fetch the value
> for a return. The datareader only sees the passed back resultset not the
> changed parameter values. You could then use ExecuteNonQuery to call the SP
> and then get the return value using the appropriate parameter value.
>
> Ron Allen
> "raulavi" <raulavi@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:BEFD3170-1040-4AB3-8AD2-61910E8D546D@xxxxxxxxxxxxxxxx
> >I am using in my vb net
> > Label1.Text = odataReader.GetString(0).ToString
> >
> > on my SQL storeProcedue
> > if my SQl ends with any
> > Select errdesc (defined as varchar(20) it works)
> > if I do
> > Return errdesc it does not.
> >
> > Why?
> >
> >
> >
> > "Cor Ligthert" wrote:
> >
> >> Raulavi,
> >>
> >> > my sql function will return a varchar(20)...
> >>
> >> A varchar is not a VBNet value.
> >>
> >> Cor
> >>
> >>
> >>
>
>
>
.