Grupos de Google ya no admite nuevas publicaciones ni suscripciones de Usenet. El contenido anterior sigue siendo visible.

Performance with SqlCeConnection

Visto 55 veces
Saltar al primer mensaje no leído

Tsukamoto@discussions.microsoft.com Julio Tsukamoto

no leída,
24 feb 2005, 15:05:0624/2/05
a
Please,
What is the better choice with the SqlCeConnection.Open / .Close :

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 eMVP

no leída,
24 feb 2005, 19:57:4624/2/05
a
It really depends on your application. In general - I'd have a strong bias
toward closing your connections - store the data in a Dataset and use it
throughout the program - CE works the opposite though of normal
SqlConnection objects - you can only open one instance but you can fire
multiple commadns on it - with that said, I still personally lean toward
closing my stuff and writing to the actual db only when I have to.

--
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...

Arun

no leída,
11 mar 2005, 5:39:0311/3/05
a
Hi Julio,

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.

0 mensajes nuevos