I'm wondering which of the following approaches is best?
1 - Add a file *.sql
as Resource , then run SqlCommand with CommandType.Text
.
2 - Add a Store Procedure to the Database, then run the SqlCommand with CommandType.StoredProcedure
.
In both cases, the parameters are added to the Parameters
of the SqlCommand list and we do not have SQL and C # mixed within the *.cs
file.
In this scenario, is it faster to run the StoreProcedude or Text ?