"Cor Ligthert[MVP]" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):
> Abubakar,
>
> As it runs, you are sure there is no close needed. The System.Data
> namespace has no classes that needs disposing of unmanaged resources
> explicitly, that is build in all other methods like the close, but
> that can build in as well. The TableAdapter has by instance the open
> and close build in.
>
> Disposing of the objects is done by the Garbage Collector, that is one
> of the reasons why it is called managed code
While I agree with this technically, doing an explicit Dispose() on the
SqlDataSource is good form. If there is extensive code after the bind,
the connection would not return to the pool until the code running was
finished. By marking for delete, the connection could be returned to the
pool even while code was running.
For most ASP.NET apps, this is not an issue, of course, as you bind and
display. But adding an explicit Dispose() comes with no cost. There is,
of course, no Close() method on the DataSource objects.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Twitter: @gbworld
Blog:
http://gregorybeamer.spaces.live.com
*******************************************
| Think outside the box! |
*******************************************