I have the following part in the end of a SQL Server stored procedure:
if(@someValue < 0)
begin
SELECT @resultIsSuccess = 0
Return @resultIsSuccess
end
else
begin
SELECT @resultIsSuccess = 1
Return @resultIsSuccess
end
where @resultIsSuccess
is of type bit
.
So, basically I am returning a bool to indicate if the procedure yielded the intended result.
On the EF side, I configured the Function Import's return type as boolean.
When I call:
bool isSuccess = context.MyFunctionImport(arg1, arg2).FirstOrDefault().Value;
I get the following exception:
The data reader returned by the store data provider does not have enough columns for the query requested.
What is the problem here?