Groups | Blog | Home
all groups > dotnet ado.net > january 2007 >

dotnet ado.net : Does TableAdaper.Fill() call Connection.Close() internally?


Ð
1/12/2007 4:10:16 PM
The Microsoft online help is full of TableAdapter examples like

customersTableAdapter1.Fill(northwindDataSet1.Customers);

I would expect the next line to be something like

customersTableAdapter1.Connection.Close();

But I haven't seen that in the code samples, and VS doesn't generate it.
William (Bill) Vaughn
1/12/2007 7:03:19 PM
Fill automatically opens and closes the Connection.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

[quoted text, click to view]

Cor Ligthert [MVP]
1/13/2007 5:41:28 AM
The tableadapter closes a connection if it has self opened that.

The tableadapter opens a connection it that is not already open.

Cor

"Ð" <pnwms@yahoo.com> schreef in bericht
news:1168647016.766189.14360@a75g2000cwd.googlegroups.com...
[quoted text, click to view]

AddThis Social Bookmark Button