Question about datatable objects and releasing resources for same
Posted on 2011-04-27
I have a database helper class that returns a datatable to the calling method. In that database helper class function, I open the connection, load the newly declared datatable, close the connection and then return the table.
My question is what keeps this from causing problems with creating a new datatable each time this is called. Couldn't I possibly run out of resources if done hundreds or thousands of times?
If I set the datatable to nothing in the calling method when I'm finished does that take care of releasing the resources created in the database helper class?