I am programing some T-SQL queries in .NET that requires a collection of string as data. The queries need to be generated in runtime. Because of some environment restriction, I cannot just create a text string like "Select ID from dataview where ID in (1, 4, 100)" and send them to SQL server. Instead I need to use SqlParameter class (https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparameter.value(v=vs.110).aspx
). Using this class I am trying to find a way to pass some collections (like (1, 4, 100)) into the query, but I found that the SqlDbType enumeration (https://msdn.microsoft.com/en-us/library/system.data.sqldbtype(v=vs.110).aspx
) does not have any collection, such that I don't know how to pass the list of values into one parameter.
Can you help me to find a way?