1 - Open the Connection and Keep always open while the application is
running and Close only when the application is Ended.
or
2 - Open and Close the Connection after use every time is necessary.
??
Tanks
--
W.G. Ryan MVP (Windows Embedded)
TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Julio Tsukamoto" <Julio Tsuk...@discussions.microsoft.com> wrote in
message news:318E3D55-39D5-443A...@microsoft.com...
Its a common practise to have a single global connection for the entire
application for perfomance.
Open it when the application starts using the database. There are some
times you have to check the state of the connection using ConnectionState
property, mostly while you work with DataReader as it needs a live
connection, and open if found closed. Its a best practise to fill you
DataSets and close the connection if there is no further need with the
command objects and data readers.