I dont know if this is the correct group to place this question, but it
seemed like the most likely. In the DAAB, I dont see any methods that
return a parameter. Is there an NonExecuteQuery method where I can use a
return parameter?

Thanks.

--
moondaddy@nospam.com

Re: Data Access Application Block Question - return param by Jim

Jim
Sat Mar 12 09:13:03 CST 2005

Does ExecuteScalar do what you need?

Private Function lookUpSingleItem(ByVal connectionString As String, ByVal
productID As Integer) As String
Try

Dim productName As String


' Call ExecuteScalar static method of SqlHelper class that returns an
Object. Then cast the return value to string.

' We pass in database connection string, command type, stored procedure
name and productID SqlParameter

productName = CType(SqlHelper.ExecuteScalar(connectionString,
CommandType.StoredProcedure, _

"getProductName", New
SqlParameter("@ProductID", productID)), String)


' return product name as a string

Return productName


Catch ex As Exception

' Log exception details

Throw ex

End Try

End Function


"moondaddy" <moondaddy@nospam.com> wrote in message
news:OsqV7VpJFHA.1860@TK2MSFTNGP15.phx.gbl...
>I dont know if this is the correct group to place this question, but it
>seemed like the most likely. In the DAAB, I dont see any methods that
>return a parameter. Is there an NonExecuteQuery method where I can use a
>return parameter?
>
> Thanks.
>
> --
> moondaddy@nospam.com
>



Re: Data Access Application Block Question - return param by moondaddy

moondaddy
Sun Mar 13 21:20:17 CST 2005

Yes, but a lot of my SPs are already setup to return a parameter and I
already have lots of code using those return parameters. I can edit the SPs
to return a scalar value, but I was just hoping there was something in the
DAAB that I could use to capture the return params.

--
moondaddy@nospam.com
"Jim Hughes" <NOSPAMJ3033@Hotmail.com> wrote in message
news:%235OuMYxJFHA.3376@TK2MSFTNGP14.phx.gbl...
> Does ExecuteScalar do what you need?
>
> Private Function lookUpSingleItem(ByVal connectionString As String, ByVal
> productID As Integer) As String
> Try
>
> Dim productName As String
>
>
> ' Call ExecuteScalar static method of SqlHelper class that returns an
> Object. Then cast the return value to string.
>
> ' We pass in database connection string, command type, stored procedure
> name and productID SqlParameter
>
> productName = CType(SqlHelper.ExecuteScalar(connectionString,
> CommandType.StoredProcedure, _
>
> "getProductName", New
> SqlParameter("@ProductID", productID)), String)
>
>
> ' return product name as a string
>
> Return productName
>
>
> Catch ex As Exception
>
> ' Log exception details
>
> Throw ex
>
> End Try
>
> End Function
>
>
> "moondaddy" <moondaddy@nospam.com> wrote in message
> news:OsqV7VpJFHA.1860@TK2MSFTNGP15.phx.gbl...
>>I dont know if this is the correct group to place this question, but it
>>seemed like the most likely. In the DAAB, I dont see any methods that
>>return a parameter. Is there an NonExecuteQuery method where I can use a
>>return parameter?
>>
>> Thanks.
>>
>> --
>> moondaddy@nospam.com
>>
>
>