Passing an array/table to stored procedure through Entity Framework

后端 未结 3 1519
说谎
说谎 2021-02-20 03:30

I am using Entity Framework with C# to make a Silverlight application. I have written some stored procedures which perform database intensive operations and I need to call them

3条回答
  •  无人及你
    2021-02-20 04:16

    If you are using SQL Server, which I assume is the case, you can create use a table valued parameter to do what you wish. Using a table valued parameter prevents you from parsing an input parameter within the stored procedure and removes the threat of a SQL injection attack by eliminating the use of dynamic SQL.

    Here is a great blog article that covers how to do what you wish to do.

    Using Table-Valued Parameters in SQL Server 2008 and C#

提交回复
热议问题