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

asp.net oledb command parameter error calling an as400 program

P: n/a
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)
Nov 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.