Best connection management

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



Hi all

I'm developing a software written in c# (.NET 2.0) with a SQL server 2005 database. I have 3 modules that need to access database:

- a simple ASP.NET website receiving event from remote devices via https calls

- a windows service running 24/7 that act as a server

- a winform application running as a client with user interface, launched by the user

3 modules use .NET remoting to communicate.

In order to query DB actually I'm using a single connection for each module, always opened (for the ASP.NET site I use a static instance of my "dbManager" class)... when I neeed to query the database I use the already opened connection and leave it opened for further operation.

Is this acceptable? what kind of problems can cause? Should I use another approach (open and close connection for every operation)?

Thanks in advance
.



Relevant Pages

  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... Create a Connection object and pass in a ConnectionString to ... manage the database table you reference. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: (Newbie)Application Roles
    ... level: the database itself. ... SQL Server accommodates these needs through the use of application ... the user's connection through a specific application. ... the connection permanently loses all permissions applied to ...
    (microsoft.public.sqlserver.security)
  • Re: Help! Set up Windows Group to access application
    ... The connection string for a trusted connection is: ... --add login as database user ... SQL Server MVP ... If you have troubles with finding your ways in Crystal Reports, ...
    (microsoft.public.sqlserver.security)
  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Visual Studio but not to VS 2003. ... Create a Connection object and pass in a ConnectionString to address ... manage the database table you reference. ... Yep, my latest book can help too, but mostly if you're targeting SQL Server ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Ada DB bindings and APQ
    ... >>I didn't like the use of handles for database objects. ... > will ensure that the connection will not go away until at least one query ... > things which can be made with a connection. ... That is different to ODBC. ...
    (comp.lang.ada)