Arch4ngel Posted April 5, 2004 Posted April 5, 2004 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 ?) Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
eramgarden Posted April 5, 2004 Posted April 5, 2004 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. Quote
Arch4ngel Posted April 5, 2004 Author Posted April 5, 2004 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 Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Moderators Robby Posted April 5, 2004 Moderators Posted April 5, 2004 Do not place these object in the Global.asax file. Do create a class for these object, it makes much more sense. Quote Visit...Bassic Software
Arch4ngel Posted April 5, 2004 Author Posted April 5, 2004 And this class... I make it static and I access it through my pages ? Does it make more sense ? Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Moderators Robby Posted April 5, 2004 Moderators Posted April 5, 2004 Read these ... http://www.xtremedotnettalk.com/showthread.php?t=80821 and http://www.xtremedotnettalk.com/showthread.php?t=82674 Quote Visit...Bassic Software
Arch4ngel Posted April 5, 2004 Author Posted April 5, 2004 Thanx helped a lot. Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.