ParameterDirection.ReturnValue parameters in DAAB

G

Guest

How do I add a return value parameter to a DBCommandWrapper in the Data
Access Application Block?

This is what I've got so far:

Dim db As Database = DatabaseFactory.CreateDatabase(INSTANCE_NAME)
Dim cmd As DBCommandWrapper =
db.GetStoredProcCommandWrapper("StoredProcWithReturnValue")
cmd.AddInParameter("@InputParam", DbType.Guid, MyID)
' TODO: RETURN VALUE PARAM TO BE ADDED HERE...

Any help/advice would be much appreciated
K.
 
G

Guest

In the version I am using there is an AddParameter function that has a
parameterDirection parameter that you can set to
ParameterDirection.ReturnValue

You would need to add a line that looked something like this:
cmd.AddParameter(null, myDataType, ParameterDirection.ReturnValue,
string.Empty, DataRowVersion.Default, null)

Jonathan
 
G

Guest

I saw the AddParameter method, but I was hoping for a more elegant solution
than passing in null parameters. I wonder why there isn't an overload without
the params that aren't required.

Thanks for your input though, your approach certainly works.
K.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top