When using a method to create and return parameterized SQL-Queries, Visual Studio Code Analysis fires Warning:
CA2000 : Microsoft.Reliability : In method 'Class1.CreateInsertCommand()', call System.IDisposable.Dispose on object 'tmpCmd' before all references to it are out of scope.
The warning is only fired after the parameter count exceeds a certain value. Please find attached a Demo-Project with which the issue can be reproduced.
Remove two or more arbitrary SQLParameter-adds to make the warning disappear.