tags:

views:

24

answers:

2

I have seen some examples that after data is read using SqlCeResultSet that a Close is called.

Do I really need to call close? What are the drawbacks if I don't close it? (does something else bad happen? Do I get memory leaks?....)

+1  A: 

Yes, you do need to Close your result sets; otherwise, you may leak native resources.

You should simply use a using block.

SLaks
Thanks for the info. Alas a using block will not work. I have a multi function use of the result set (ie one method to setup a table, another to do all my inserts updates and deletes on a table.) I will just close before I setup my table. Thanks again!
Vaccano
+1  A: 

The drawback if you don't close the result set yourself is that the resources won't be freed until the garbage collector gets around to it. A lot of garbage collectors are lazy, so who knows when that will be!

odd parity