Dear community,
I have a c# program which shall execute a CMD called IT001CMD on my iSeries (V7R1).
The CMD is located in the library BEMOBJ.
I'd like to call the CMD using QCMDEXC via ODBC connection.
So I try to execute the following SQL-statement:
Call QSYS.QCMDEXC('BEMOBJ/IT001CMD', 0000000015.00000)
When I execute the SQL-statement in the OS/400-SQL-Environment all works fine.
But it still prompts error CPF0006 when using the c# programm and i cannot understand why this error is prompted.
The CMD starts a CL-PGM which starts a RPGLE-PGM that generates a list of address labels.
Please help me to fix this problem.
Thank you very much in advance.
Kind regards,
Sascha
I have a c# program which shall execute a CMD called IT001CMD on my iSeries (V7R1).
The CMD is located in the library BEMOBJ.
I'd like to call the CMD using QCMDEXC via ODBC connection.
So I try to execute the following SQL-statement:
Call QSYS.QCMDEXC('BEMOBJ/IT001CMD', 0000000015.00000)
When I execute the SQL-statement in the OS/400-SQL-Environment all works fine.
But it still prompts error CPF0006 when using the c# programm and i cannot understand why this error is prompted.
Code:
static public int StartLabelGenerator() { OdbcConnection oConn = new OdbcConnection(ConnectionString); oConn.Open(); String sqlcmd; sqlcmd = "Call QSYS.QCMDEXC('BEMOBJ/IT001CMD', " + ("BEMOBJ/IT001CMD".Length).ToString("0000000000.00000").Replace(",", ".") + ")"; OdbcCommand oCmd = new OdbcCommand(sqlcmd, oConn); try { int i = oCmd.ExecuteNonQuery(); return i; } catch (Exception ex) { MessageBox.Show(ex.Message); return 0; } finally { oCmd.Dispose(); oConn.Close(); } }
Please help me to fix this problem.
Thank you very much in advance.
Kind regards,
Sascha
Comment