Re: Closing connections!
From: William \(Bill\) Vaughn (billvaRemoveThis_at_nwlink.com)
Date: 12/27/04
- Next message: Kevin Yu [MSFT]: "RE: -2147217864 Row cannot be located for updating."
- Previous message: Matt S: "Easy way to exclude duplicate entries in recordset...."
- In reply to: Nab: "Closing connections!"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 27 Dec 2004 13:55:39 -0800
ADO.NET gives you the option of choosing a connected or disconnected
approach. Yes, the Fill method does close connections automatically, but it
leaves the connection state unchanged if you open the connection first. When
working with ASP architectures, you need to make sure connections are closed
(and ADO.NET's Fill can do that for you), but when working with
client/server Windows Forms applications, it sometimes makes sense to leave
connections open while the application is open. ADO.NET does not
automatically close any connection you open manually--that must be done in
your code. Unlike ADO classic (and VB6) you can't depend on the garbage
collector to close connections for you.
hth
-- ____________________________________ William (Bill) Vaughn Author, Mentor, Consultant Microsoft MVP 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. __________________________________ "Nab" <Nab@discussions.microsoft.com> wrote in message news:07AFE509-8C0E-4668-AD4A-F0E5C1AB5A7C@microsoft.com... > Can someone please tell me why most text books talk about the importance > of > closing connections after opening them when ADO .Net supports a > disconnected > data access model? > > Why bother closing connections if ADO .Net does that automatically? > > I will be grateful for some insights on this matter as I am new in this > rea. > > Regards.
- Next message: Kevin Yu [MSFT]: "RE: -2147217864 Row cannot be located for updating."
- Previous message: Matt S: "Easy way to exclude duplicate entries in recordset...."
- In reply to: Nab: "Closing connections!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|