SqlCommand.Dispose() not disposing the SqlParameters in it - Memory Leak - C#.NET
- by NLV
Hello
I've a windows forms application with MS SQL Server 2005 as the back end. I have written code in the form to call few stored procedures using SqlConnection, SqlCommand objects and i properly dispose everything.
I've disposed sqlcommand object by calling
oSqlCommand.Dispose()
But i witnessed my application consuming huge amount of memory. I basically pass large XML files as SqlParameters.
I finally decided to memory profile it using RedGate Memory profiler and i noticed that the System.Data.SqlClient.SqlParameters are not disposed.
Any insights on this?
Thanks
NLV