Global - Dummy boy again

Arch4ngel

Senior Contributor
Joined
Mar 22, 2004
Messages
940
Location
Montreal, QC
Did I drink too much beer last weekend ?

Okay... I want to put all my SqlDataAdapter and SqlConnection in my Global.asax because I used them so often that it's too much trouble putting them apart in each page.

How can I resolve my problem ? I wanted to resolve it by property but... I need to instanciate Global to access them... so they don't containt much information from page to page.

Solution ?

N.B.: The use of Session or Application isn't recommended. Since putting an object in their content lock an application thread as long as it is present... I'll loose a bunch of performance. (Learned this at school... is it right ?)
 
put it in Web.config. I was told if it's put in global.asax, then whenever u change the connection, u need to recompile.
 
Recompilation is automatic on ASP.NET pages (what they told me)
Okay... What do I do to add it to Web.Config ?

I'm talking about SqlDataAdapter and SqlConnection objects. Not a connection string.

:) :p
 
Do not place these object in the Global.asax file. Do create a class for these object, it makes much more sense.
 
Back
Top