Re: static class confirmation



I think your right there, i just tried this on one of our IIS servers and
the same behaviour appeared.

I think because the connection string is not changing asp.net is intellegent
enough not to need to recreate the class for multiple users.

If you actually change the ConnectionString property and then push this out
to your live server, all users on your server will actually be forced to
refresh there current session and all there Session variables are cleared.

This is actually quite clever and will be changing a number of things on our
own website to take this behaviour into account.

Regards

"Steven Blair" <steven.blair@xxxxxxxxxxxxxx> wrote in message
news:eF$BRSCSGHA.4792@xxxxxxxxxxxxxxxxxxxxxxx
Using ASP.NET 2.0 and Visual Studio 2005

I have website and a DLL attached to it (BusLayer). The class inside the
dll (also imaginatively named BusLayer) havea number of static
variables. One example:

public static connectionString;

Website is running from IIS.

Am I right in saying that this BusLayer class is shared amongst ALL
intances of my website. If I access the site from my PC, and a friend
accesses from a different PC, then we are using the same variable called
connectionString?

I ran a test and put a line of trace in the static constructor (the
whole class is static) and this line was only written out once, even
when I had multiple users access my site.

Thanks in advance.

Steven



*** Sent via Developersdex http://www.developersdex.com ***


.



Relevant Pages

  • Re: HELP PLEASE ~ ???
    ... is your Membership provider specifying a connectionStringName? ... For example, if you have a connectionString you are using for your membership and roles called mySqlConnection, your provider would look similar to: ... The files are all now sitting on my Server, and when I load my web ... The connection string specifies a local Sql Server Express instance ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: HELP PLEASE ~ ???
    ... if you have a connectionString you are using for your ... The files are all now sitting on my Server, and when I load my web ... Server Express 2005 database. ... The connection string specifies a local Sql Server Express instance ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: HELP PLEASE ~ ???
    ... You can check the real name of the Membership's application name by going to your SQL Server, open up the aspnet_Applications table and view the LoweredApplicationName column. ... if you have a connectionString you are using for your ... The connection string specifies a local Sql Server Express instance ...
    (microsoft.public.dotnet.framework.aspnet)
  • SQL Connection Problem
    ... An error has occurred while establishing a connection to the server. ... database location within the applications App_Data directory. ... Boolean& failoverDemandDone, String host, String failoverPartner, String ... user, String password, Boolean trusted, String connectionString) +68 ...
    (microsoft.public.dotnet.framework.aspnet)
  • Web Part and Access database
    ... Server Error in '/Webparts' Application. ... SQLExpress database file auto-creation error: ... The connection string specifies a local Sql Server Express instance ... String user, String password, Boolean trusted, String connectionString) ...
    (microsoft.public.sharepoint.portalserver.development)