From 33ae746399cdbea8c838b1cc6d0b26258eefac87 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 15 Nov 2022 16:40:08 +0100 Subject: [PATCH] ZUGFeRDRESTService: Fix procedure call --- .../Controllers/ValidationController.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/WEBSERVICES/ZUGFeRDRESTService/Controllers/ValidationController.cs b/WEBSERVICES/ZUGFeRDRESTService/Controllers/ValidationController.cs index a362aa8d..77299759 100644 --- a/WEBSERVICES/ZUGFeRDRESTService/Controllers/ValidationController.cs +++ b/WEBSERVICES/ZUGFeRDRESTService/Controllers/ValidationController.cs @@ -192,13 +192,16 @@ namespace ZUGFeRDRESTService.Controllers _logger.Debug("Calling validation prodecure."); try { - using SqlCommand oCommand = new SqlCommand("EXEC PRCUST_INV_CHECK_FROM_PORTAL @REF_GUID, @MSG_OUTPUT"); - oCommand.Parameters.Add("REF_GUID", System.Data.SqlDbType.VarChar, 250).Value = oMessageId; - oCommand.Parameters.Add("MSG_OUTPUT", System.Data.SqlDbType.VarChar, 500).Direction = System.Data.ParameterDirection.Output; + using SqlCommand oCommand = new SqlCommand("PRCUST_INV_CHECK_FROM_PORTAL"); + oCommand.CommandType = System.Data.CommandType.StoredProcedure; + + oCommand.Parameters.Clear(); + oCommand.Parameters.Add("@REF_GUID", System.Data.SqlDbType.VarChar, 250).Value = oMessageId; + oCommand.Parameters.Add("@MSG_OUTPUT", System.Data.SqlDbType.VarChar, 500).Direction = System.Data.ParameterDirection.Output; if (_database.MSSQL.ExecuteNonQuery(oCommand)) { - string oReturnValue = (string)oCommand.Parameters["MSG_OUTPUT"].Value; + string oReturnValue = (string)oCommand.Parameters["@MSG_OUTPUT"].Value; return new Tuple(true, oReturnValue); }