Re: Making a database connection global

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



Using only one single database connection for a web application? Good one...

You could just as well neuter the web server by only allowing one single thread, as the other threads only will be waiting for the connection to get free.

What database are you using? If you are only going to use a single connection against it you should consider downgrading to something low-grade like MSDE or Access. Or why not anything even simpler like storing the data in text files?


Terry Jolly wrote:
Web Solution

Goal: Have a global database connection
Why: (There will be 30+ tables, represented by 30+ classes) I only want to reference the database connection once.

I put the connection string in the web.config.
I created a class with a static database connection and the class opens and closes the database.

This seems to work so the question: Is there a better way to handle the database connection?

Thanks In Advance.
.



Relevant Pages

  • Re: How can i get a form on frontpage to send gathered data to a d
    ... > ASP pages won't preview in the browser - it will warn you about having to publish ... > the pages first to a web server. ... >> Im trying to create a web based form for a school project. ... create a database connection in the ...
    (microsoft.public.frontpage.client)
  • Re: Secure database retrieval
    ... the database connection. ... is security really an issue? ... problems than snooping localhost, like cracking MySQL directly. ... If PhpMyAdmin is not set up on a secure web server, ...
    (comp.lang.php)
  • Re: Making a database connection global
    ... Anyway, if he don't want to listen, a different angle will probably not work anyway. ... You could just as well neuter the web server by only allowing one single thread, as the other threads only will be waiting for the connection to get free. ... I only want to reference the database connection once. ... I created a class with a static database connection and the class opens and closes the database. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Making a database connection global
    ... It doesn't help answering the question in this sort of vein. ... You could just as well neuter the web server by only allowing one single thread, as the other threads only will be waiting for the connection to get free. ... I only want to reference the database connection once. ... I created a class with a static database connection and the class opens and closes the database. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Vb.net and ASP.
    ... I've just started on the frist web project, using vb.net 2005 to create the ... ASP required for the database connection to a web server. ... Seth Rowe [MVP] ...
    (microsoft.public.dotnet.languages.vb)