SQL Passing a List<int> as a SqlCommand Parameter

Posted by Christopher Kelly on Server Fault See other posts from Server Fault or by Christopher Kelly
Published on 2010-05-14T15:44:34Z Indexed on 2010/05/14 15:56 UTC
Read the original article Hit count: 327

Filed under:
|
|

can i pass a List into a SqlCommand as a paramter?

DELETE FROM MyTable WHERE Key IN @MyParam

command.Parameters.AddValue("MyParam",MyList);

i realize i could just loop over the list but i was looking for a cleaner solution.

© Server Fault or respective owner

Related posts about sql

Related posts about c#