locked
Question about Getting Data by using LINQ-SQL OR Stored Procedure RRS feed

  • 問題

  • 你好

    我想問下呢
    用LINQ + SQL RETRIEVE DATA 好D
    OR 用 STORED PROCEDURE 去 RETRIEVE DATA 好D?

    用stored procedure 應該會flexible d
    因為改code 時唔要republish 個 application
    但development 方面 用 linq 好似方便好多
    唔知邊個方法會EFFICIENT D 呢?

    因為見到好多WEBSITE 都會.NET3.5 用 LINQ 加 SQL

    我現在先開始接觸 SQL 2008 唔知用 LINQ + SQL  好OR STORED PROCEDURE 好

    希望大家可以講解下
    等我對LINQ SQL/ STORED PROCEDURE 既用法/幾時會用
    等我可以明確 D明白個中既IDEA

    謝謝大家
    2008年7月23日 下午 09:21

解答

  • Hello chiyau,
              In my opinion,they have there own advantages respectivly. Stored procedure is mainly used to prevent the sql injection issue, Linq is used to provide a more efficient way to access database's data more efficiently, usually it is an upgrade version to ADO.NET.

    You can refer to msdn to get more information about the usage of LINQ and T-SQL.
    2008年8月4日 上午 03:02