I am not sure what is going wrong here. I have a stored procedure that
calls an SQLRPGLE program. The program is running fine as I have
verified in the debugger and sends the return value as expected.
Instead what is returned when looking at
`cmd.Parameters["@ISMATCH"].Value` is {}. I am guessing I am doing
something wrong. What could it be?

public bool IsValidTimesheet(int id)
{
bool isValid = false;

// Get the data from the iSeries
using (iDB2Connection conn = new
iDB2Connection(ConfigurationManager.ConnectionStrings["IbmIConnectionString"].ConnectionString))
{
using (iDB2Command cmd = conn.CreateCommand())
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "LIB.CHECKHOURS";

cmd.Parameters.Add("@EMPLOYEEID",
iDB2DbType.iDB2Decimal).Value = id;
cmd.Parameters.Add("@ISMATCH",
iDB2DbType.iDB2Char).Direction = ParameterDirection.Output;
conn.Open();
cmd.ExecuteNonQuery();
isValid = (cmd.Parameters["@ISMATCH"].Value.ToString()
== "1") ? true : false;
conn.Close();
}
}

return isValid;
}

I have the rest of the code documented at
http://stackoverflow.com/q/5238834/2535.

--
Mike Wills
http://mikewills.me

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.