I have a strange error I am trying to figure out. I am getting
a DB2ConversionException on an ExecuteNonQuery(). I am running a stored
procedure that calls an RPG program. This works perfect on my own PC.
However, when I publish it to the web server, I get the error.
        public void SignTimeSheet(Timesheet timesheet, string approved)
        {
            // Get the data from the iSeries
            using (iDB2Connection conn = new iDB2Connection(_CONNSTRING))
            {
                conn.Open();
                iDB2Command cmd = conn.CreateCommand();
                cmd.CommandType = CommandType.StoredProcedure;
                if ((String.IsNullOrEmpty(timesheet.SupervisorComments)) &&
(approved == " "))
                {
                    cmd.CommandText = "MPRLIB.APPROVETIMESHEET";
                    cmd.Parameters.Add("@SSN",
timesheet.EmployeeUniqueKey.ToString("0000000000"));
                    cmd.Parameters.Add("@PAPER",
timesheet.EmployeeSignedPaper);
                    cmd.Parameters.Add("@SUPERVISORID",
timesheet.SupervisorUserId);
                    cmd.Parameters.Add("@SIGNEDUSER",
timesheet.SupervisorSignedBy);
                    cmd.Parameters.Add("@WORKSTATION",
timesheet.SupervisorSignedComputer);
                }
                else
                {
                    cmd.CommandText = "MPRLIB.APPROVETIMESHEETWCOMMENT";
                    cmd.Parameters.Add("@SSN",
timesheet.EmployeeUniqueKey.ToString("0000000000"));
                    cmd.Parameters.Add("@PAPER",
timesheet.EmployeeSignedPaper);
                    cmd.Parameters.Add("@APPROVE", approved);
                    cmd.Parameters.Add("@SIGNEDUSER",
timesheet.SupervisorSignedBy);
                    cmd.Parameters.Add("@WORKSTATION",
timesheet.SupervisorSignedComputer);
                    cmd.Parameters.Add("@COMMENT",
timesheet.SupervisorComments);
                }
                cmd.ExecuteNonQuery();
                conn.Close();
            }
        }
Any ideas on what it might be or how to debug this on the server?
--
Mike Wills
http://mikewills.info
As an Amazon Associate we earn from qualifying purchases.