1. at the start of my application open a connection and pass this connection
to all the data acesss components. On the exit of my applicatie close the
connection again.
2. share a connection string with all the data access components and every
time i perform a database action open and close a connection.
Whats do you guys think is the best way?
Jonne
It really depends on your usage. I do two things in my code. First I use a
private static SqlCeConnection so I never attempt to create a second
connection (which will fail on SQL Server CE). Second, I always Close(),
then Open() my connection. There is no exception thrown for closing a
closed connection. This way, I never run into an exception for trying to
open a connection that is already open.
Definately Close() the connection on application close.
--
Kevin Boske
SQL Server CE Team
Microsoft
----------------------------------------------------------------------------
----------------------------------------
Everything you need to know about SQL Server CE:
http://www.microsoft.com/sql/ce/techinfo/default.asp
----------------------------------------------------------------------------
----------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
----------------------------------------------------------------------------
----------------------------------------
"Jonne Kats" <--jk...@advisor.nl> wrote in message
news:eTNa09hwCHA.1872@TK2MSFTNGP12...
1. Open your connection at the start, close at the end. Pass this open
connection to all the data access components
2. Pass a connectionstring to all the data access components and
create a new connection every time i perform a database action.
TIA
"Kevin Boske - [MS]" <kbo...@online.microsoft.com> wrote in message news:<eszMqblwCHA.1620@TK2MSFTNGP11>...
--
Kevin Boske
SQL Server CE Team
Microsoft
----------------------------------------------------------------------------
----------------------------------------
Everything you need to know about SQL Server CE:
http://www.microsoft.com/sql/ce/techinfo/default.asp
----------------------------------------------------------------------------
----------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
----------------------------------------------------------------------------
----------------------------------------
"Jonne" <jk...@advisor.nl> wrote in message
news:24d3dbcd.03020...@posting.google.com...