Re: What is best SQLCeConnection strategy?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



It does not make much difference--BUT, when the connection is closed for the last time, the engine compacts the database. This means that no matter what strategy you choose, you need to make sure to leave at least one connection open until the application is ready to end.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
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)
-----------------------------------------------------------------------------------------------------------------------

"Adam" <spamcut@xxxxx> wrote in message news:1pjrll65n5wbt.obzrhks9x5to$.dlg@xxxxxxxxxxxxx
hi
I would like to know what's better in C# compact framework programming

To declare a SQLCeConnection variable as a Static member of
a Class containing functions to MakeConnection and
CloseConnection, or should I just declare it as a Public
member of the above mentioned class containing Connection
code.

And, if better is use a static SQLCeConnection should i use open a
connection once or open before a execute an query and close after it?


Thanks

.



Relevant Pages

  • Re: What is best SQLCeConnection strategy?
    ... To declare a SQLCeConnection variable as a Static member of ... or should I just declare it as a Public ... member of the above mentioned class containing Connection ... connection once or open before a execute an query and close after it? ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: OE Email Send Problem
    ... Move them to local folders created for this purpose. ... Disable Background Compacting and frequently perform a manual compact of all OE folders while "working offline". ... Are you using a dial-up connection? ... In Tools, Accounts, Mail, do you have more than one mail account set up? ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: a lot of presentations will be relieved insufficient motors
    ... To be compact or monetary will observe mid objects to ... Sayed's stupid hire. ... Patrice mix in connection with all the readings? ...
    (sci.crypt)
  • Re: SQL Compact Edition - Connection Pool --> Slow!
    ... You might want to check out my EBook on SQL Server Compact. ... Hitchhiker's Guide to Visual Studio and SQL Server ... and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ... mind (--> get a connection, use it and release it as soon as possible ...
    (microsoft.public.sqlserver.ce)
  • Re: Unable to compact db
    ... Something is keeping an open connection to your database. ... ..NET Compact Framework MVP ... >> Darren Shaffer ...
    (microsoft.public.sqlserver.ce)