I''d like to know what will happen to dataset when its table is being returned within its using statement. Example a function with code as follow:
using tmpDataSet = MySqlHelper.ExecuteDataSet(_connString, strSQL)
if tmpDataSet is not nothing andalso tmpDataSet.Tables.Count > 0 then
return tmpDataSet.Tables(0)
end if
end using
I want to have a function which will provide me requested datatable, and will dispose the datatable whenever I am done playing with it. I just wonder, whether the dataset will be disposed properly while its table is being returned, as I do not want this will cause memory leak.