Using stored procedures with LINQ
-
13-04-2021 - |
Pergunta
I want to use LINQ to call stored procedure in this way but stored procedure I want to call contain SQL string that executed by
EXEC sp_executesql @strSQL
In this way Visual Studio does not generate result class. To resolve this problem I execute SQL string by
INSERT INTO @Temp EXEC sp_executesql @strSQL
SELECT * from @Temp
Maybe it is not the best way but it works. The problem is that it sometimes return items in wrong sequence. How to fix it?
Solução
Use an Order By to specify the sort order
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow