I don't see an issue with this technique, although this is probably more suited for
code review, however, I personally would not bother reusing the connection object. You don't gain anything from this, and it could cause you issues, simply use your configuration for a static connection string, and create a new SqlConnection object within the method. In addition, you can simplify the code very slightly by using
command.Parameters.AddRange(parameters);
instead of am explicit foreach loop. —
GarethD 36 secs ago