Any Reason To Wrap TableAdapter With a Using Statement?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
Is there any reason to wrap a TableAdapter with a using statement? I don't
think there is any reason to but I found example code that did.
Thanks in advance!!!

using (TransactionScope updateTransaction = new TransactionScope())
{
using (MyTableAdapter adapter = new MyTableAdapter())
{
adapter.Update(reportsWatcherDs);
}

updateTransaction.Complete();
}
 
It is a good strategy to call Dispose on every class implementing
IDisposable.
If it isn't required right now it might change in the future.
 
Back
Top