Hi, I have some memory leak in my C# code I have a class with some SqlCommand fields inside it. I also have an Initialize() public method that allocates these SqlCommands fields.
Before the allocation I check (in the Initialize's code) whether it not the first time I do allocation (i.e not the first time Initialize is called) and if it's not the first time I call Dispose on the SqlCommands, and it seems to cause a memory leak....
Now it's important to mention that all the SqlCommands use the same SqlConnection and this connection is alive during all the program's life. The connection is accessed via a static property of some static class... (let's call it ConnectionManager)
Any idea what might be the problem? Thanks!