Hi, I'm using vs2013, C# and asp.net web form
I have a method that is invoked when users clicks on a button on my web page. The method retrieves data, puts in a dataset which I then assign that dataset to be the data source for a gridview control. This gridview control will live through the life of this web page. The application has been running fine without complaints about the dataset but I just noticed in my code in the finally block this dataset is Disposed();
1. Should I not dispose the dataset? Why has it been working?
2. Should I create this dataset as a global variable at the page class level so it won't get disposed when the method is finished, it went out of scope so will be dispose too.