Cannot get value from output parameter of stored procedure when ExecuteQuery

Hi guys,

I have 1 issue when using Execute Query. I specified all necessary, but I always get empty value from Output parameter.
I already assigned ID = 1 in Sequence

I tested in the procedure in sql database, it runs OK
Do you have any advice or have you ever met this issue?

The Output vlue will be in the Output Datatable Property.
Can you try once by using Datatable.Rows(0)(“@issuedItemMaterialId”) and so on

Thanks Priyanka,

I’ve tried your solution. The system said that there is no rows(0). It seems that this activity does not work with output para. I have to change my stored procedure in database like this
and use Table.Rows(0).Items(“IssuedItemMaterialName”) to get value from IssuedItemMaterialName

ALTER PROCEDURE [dbo].[GetIssuedItem]
@id int
– SET NOCOUNT ON added to prevent extra result sets from
– interfering with SELECT statements.

SELECT IssuedItemMaterialId, IssuedItemMaterialName, IssuedItemLotNo
FROM IssuedForProduction
WHERE ID = @id


1 Like


if you want to get values form the stored-procedure via output-parameters, you need to use ExecuteNonQuery instead of ExecuteQuery.
ExecuteQuery only returns a Datatable → result from the procedure
ExecuteNonQuery returns how many rows are affected in the output-datatable and the output-parameters.

Best regards,

1 Like