I had to do something like this resent, I converted the list (or could be an array) into a comma delimited string and passed that over as a varchar into the stored procedure.
you cannot pass a collection as a single parameter. each value is separate parameter. there are ways to parse a string into a table on the database side and use joins/sub-selects, but this is specific to each database server.
I would recommend using an ORM framework to manage all the sql conversion for you. this makes it much easier to write queries using an object model rather than tsql.
NHibernate, ActiveRecord and LLBL($) are the popular ones.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.