What is the best strategy to avoid hard coded SQL statements

后端 未结 5 673
悲哀的现实
悲哀的现实 2021-01-23 02:00

The other day I was showing a colleague some code I was working on, and in the passing he commented on the fact that I have hard coded SQL statements. Now these SQL Statements a

5条回答
  •  再見小時候
    2021-01-23 02:50

    I avoid harder coded SQL at all costs. I prefer to call Store Procedures.

    If you are using .NET 3.5 and MS SQL Server you might look at LINQ, which then your SQL statements are in code.

提交回复
热议问题