0

I have SP like this

CREATE PROCEDURE dbo.pPersonGetIDByName
@Name nvarchar(50),
@ID int output
AS ...

and appropriate DataAccessor method

[ScalarSource(ScalarSourceType.OutputParameter)]
abstract int GetIDByName(string Name);

I understand it as 'call stored procedure, pass Name parameter and return me first output parameter as a result'. But this call

id = pa.GetIDByName("testname");

Returns me error

Procedure or function 'pPersonGetIDByName' expects parameter '@ID', which was not supplied.

As far as I can see in examples (OutputParameterTest()) it should be OK. SQL Server call is correct:

declare @p2 int
set @p2=default
exec pPersonGetIDByName @Name=N'testname',@ID=@p2 output
select @p2

What is wrong?

Alsin
  • 1,514
  • 1
  • 14
  • 18

1 Answers1

0

Have you tried passing the parameter name :

[ScalarSource(ScalarSourceType.OutputParameter, "ID")]
abstract int GetIDByName(string Name);
McX
  • 1,296
  • 2
  • 12
  • 16