2

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?

shtkuh
  • 349
  • 1
  • 10
  • 22

1 Answers1

1

Use an Order By to specify the sort order

Ian Nelson
  • 57,123
  • 20
  • 76
  • 103
Joe
  • 2,987
  • 15
  • 24