Can't make ScalarSource in DataAccessor to work

21 views
Skip to first unread message

alexander...@gmail.com

unread,
Oct 9, 2014, 8:36:27 AM10/9/14
to blto...@googlegroups.com

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'testname2',@ID=@p2 output
select @p2

What is wrong?


Reply all
Reply to author
Forward
0 new messages