Hi,

I'm developing a VB ASP.NET application accessing mainframe DB2 stored procedure (with external COBOL program). I'm able to connect and execute the stored procedure, and getting result set back. However, I'm having trouble getting the (OUTPUT) value passed back from the stored procedure. Here is my code:

Dim dbConn As OleDb.OleDbConnection
Dim objReader As OleDb.OleDbDataReader

dbConn = New OleDb.OleDbConnection(Application("IBMDSN"))
dbConn.Open()

Dim objCmd As OleDb.OleDbCommand = New OleDb.OleDbCommand("{call CM96.EJJ790(?, ?)}", dbConn)

objCmd.CommandType = CommandType.Text

objCmd.Parameters.Add("PARAMIN", OleDb.OleDbType.Char, 254)
objCmd.Parameters("PARAMIN").Direction = ParameterDirection.Input
objCmd.Parameters("PARAMIN").Value = "001C02"

objCmd.Parameters.Add("PARAMOUT", OleDb.OleDbType.Char, 254).Value = 0
objCmd.Parameters("PARAMOUT").Direction = ParameterDirection.Output

objReader = objCmd.ExecuteReader

TextBox1.Text = objCmd.Parameters("PARAMOUT").Value


The value of the PARAMOUT is always empty. The stored procedure has been tested in mainframe environment, and it does returns value for the OUTPUT parameter. Any help is greatly appreciated.

Thanks.