By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,089 Members | 2,283 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,089 IT Pros & Developers. It's quick & easy.

Read ouput parameters from stored procedure.

P: 3
I am trying to find the value from some output parameters from a stored procedure. I have tried several different methods but somehow cannot get it to work. here is my source code:

dim dr as ODBCDataReader
Dim comm as New ODBCCommand("{call jgrant_awcconnect..edit_equipment (?, ?, ?, ?, ?, ?)}", conn)

comm.parameters.add("@equipmentId", System.Data.SqlDbType.bigint)
comm.parameters("@equipmentId").Direction = ParameterDirection.Input
comm.parameters("@equipmentId").value = CInt(session("EquipmentId"))
comm.parameters.add("@Short", System.Data.SqlDbType.Nvarchar)
comm.parameters("@Short").size = 20
comm.parameters("@Short").Direction = ParameterDirection.Output
comm.parameters.add("@Long", System.Data.SqlDbType.Nvarchar)
comm.parameters("@Long").size = 50
comm.parameters("@Long").Direction = ParameterDirection.Output
comm.parameters.add("@Owned", System.Data.SqlDbType.Nvarchar)
comm.parameters("@Owned").size = 3
comm.parameters("@Owned").Direction = ParameterDirection.Output
comm.parameters("@Job_Price").Direction = ParameterDirection.Output
comm.parameters("@Long").Direction = ParameterDirection.Output

dr = comm.executereader()
txtShort.text = comm.parameters("@Owned").value
txtLong.text = comm.parameters("@Owned").value

This code doesnt generate any errors but also does not display the right value. Anybody have any thoughts?
Aug 26 '07 #1
Share this Question
Share on Google+
2 Replies

P: 14
try to use 'ParameterDirection.ReturnValue' rather than output
what ever value you return from stored procedure will be available in this returnValue in the front end
For better ubderstanding please refer the following link

Aug 27 '07 #2

P: 3
I am trying to read the parameters not the return value. But good tip, I will use that in the future.
Aug 27 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.