asp.net oledb command parameter error calling an as400 program

M

Manuel Arroba

asp.net oledb command parameter error calling an as400 program
Hi...

I have an as400 program that I can call it directly and it works:

variable= "xxxx"
sql = "CALL METSIGOP.SIGOPRC ('" + variable + "')"
Dim con As OleDbConnection
Dim cmd As OleDbCommand
con = New OleDbConnection()
cmd = New OleDbCommand()
con.ConnectionString = StrCon
cmd.Connection = con
cmd.CommandType = CommandType.Text
cmd.CommandText = sql
con.Open()
Try

cmd.ExecuteNonQuery()

No errors, it works fine.

The program I call, uses a inputouput parameter, so we would like to
check the variable return:


Dim con As OleDbConnection
Dim cmd As OleDbCommand
con = New OleDbConnection()
cmd = New OleDbCommand()
con.ConnectionString = StrCon
cmd.Connection = con
cmd.CommandType = CommandType.Text
cmd.CommandText = "CALL METSIGOP.SIGOPRC (?)" '
Dim parametro As New OleDbParameter("XURRO",
OleDb.OleDbType.Char, 128)
parametro.Value = "xxxxx"
parametro.Direction = ParameterDirection.InputOutput
cmd.Parameters.Add(parametro)
con.Open()

Try

cmd.ExecuteNonQuery() <=== now I get an error:

SQL: CALL METSIGOP.SIGOPRC ('xxxxx')
Mensaje: SQL0204: SIGOPRC in METSIGOP of type *N not found.
Origen: IBMDA400 Command
SQLState:

Does anyone have any idea about what i am doing wrong ?...
Thanks in adavance... have a nice day..
Miguel Canals (Barcelona, Spain)
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top