title: How to pass sqlparameter to IN()?
body: <p>For some reason the Sqlparameter for my IN() clause is not working. The code compiles fine, and the query works if I substitute the parameter with the actual values</p>
  
  <pre><code>StringBuilder sb = new StringBuilder();
              foreach (User user in UserList)
              {
                  sb.Append(user.UserId + ",");
              }
  
              string userIds = sb.ToString();
              userIds = userIds.TrimEnd(new char[] { ',' });
  
  
  SELECT userId, username 
  FROM Users 
  WHERE userId IN (@UserIds) 
  </code></pre>