
Originally Posted by
jmcilhinney
You are correct, but you aren't done with the DataTable, are you? ..... but the DataTable will be used elsewhere so it is not appropriate to dispose it.
Maybe it depends on how I use the function. I normally would do:
Code:
Dim myDT as DataTable = FilledTable("some sql query goes here")
Once I call the function & assign the returned data to 'myDT' I am done with the DataTable within the function as I see it, so it seems appropriate to dispose of it in the function, via a Using block. Please tell me if my understanding is incorrect.