Is there a way to pass a list into a SqlCommand
so it doesn’t try to convert the string to int? IE:
I can do this:
SqlCommand command = new SqlCommand("SELECT * FROM modules WHERE (moduleID IN (2,3,4))", connection);
But this tries to convert it and breaks
SqlCommand command = new SqlCommand("SELECT * FROM modules WHERE (moduleID IN (@modulelist))", connection);
command.Parameters.AddWithValue("@modulelist", "2,3,4");