Parameterising the IN clause of an SQL SELECT in .NET
- π
- π 401 words
- π 2 minutes
- π¦ .NET
- π·οΈ SQL, C#
- π¬ 6 responses
Iβm a fan of parameterized queries with a strong dislike for building SQL (or other magic strings). Encoding, escaping errors, localization formatting problems and injection can run rampant when you think everything is a string.
Today I found myself a quandary as I needed to SELECT records based on a list of values I had. e.g.