Using Disposable object
First method is to use the “Using” keyword which is quite clean and simple using (IDisposable obj = new DataTable()) { //do your logic with obj variable } Second method is to use Try and finally…
First method is to use the “Using” keyword which is quite clean and simple using (IDisposable obj = new DataTable()) { //do your logic with obj variable } Second method is to use Try and finally…