You don't need to call Dispose (though some will argue that you should
always call Dispose anything that has this method). It won't hurt to call
it, but calling it isn't going to gain you anything.
You can reuse command objects, but not reusing them shouldn't cause memory
problems.
I would guess your memory problem stems from something else.
"Jim Heavey" <(E-Mail Removed)> wrote in message
news

FC7E417-2DB7-487F-B4B3-(E-Mail Removed)...
> Hello, I am hoping this is a simple question....
> If I am processing a file and re-using the same connection object be
> creating new Command objectes for each of the records on the file, do I
> need
> to run the command.Dispose() method when I am done with each command? My
> memory usage continues to grow and grow and I am trying to figure out why
> it
> continues to grow and grow until it finally fails with an out of memory
> condition.
>
> Can I reuse the same command object for inserting multiple records into
> the
> database - If I can, maybe this would help with my memory problem.
>
> Thanks in advance for your assistance!!!