Connection in Win App

hi,
want to ask something..

in .NET Win App what is the prefer method
1. Open connection when program start and Close it when program end
or
2. Open connection whenever it needed and close it after that

thanks
[252 byte] By [erickwidya] at [2007-11-19 10:50:58]
# 1 Re: Connection in Win App
Generally, its better to consolidate your statements against the database and open/close a connection when needed.

Heres some good reference material:
http://msdn.microsoft.com/msdnmag/issues/05/05/DataPoints/default.aspx
Craig Gemmill at 2007-11-10 3:17:00 >
# 2 Re: Connection in Win App
thanks Craig
erickwidya at 2007-11-10 3:18:00 >