Click here to Skip to main content
15,924,828 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: pointing to the outside folder Pin
pmarfleet11-Jan-08 9:42
pmarfleet11-Jan-08 9:42 
GeneralRe: pointing to the outside folder Pin
hurrem11-Jan-08 10:27
hurrem11-Jan-08 10:27 
GeneralRe: pointing to the outside folder Pin
pmarfleet11-Jan-08 10:41
pmarfleet11-Jan-08 10:41 
GeneralRe: pointing to the outside folder Pin
hurrem11-Jan-08 10:50
hurrem11-Jan-08 10:50 
GeneralRe: pointing to the outside folder Pin
pmarfleet11-Jan-08 10:59
pmarfleet11-Jan-08 10:59 
GeneralRe: pointing to the outside folder Pin
hurrem11-Jan-08 14:35
hurrem11-Jan-08 14:35 
GeneralRe: pointing to the outside folder Pin
pmarfleet11-Jan-08 22:05
pmarfleet11-Jan-08 22:05 
GeneralAsp.Net keeping connection to db Pin
Monin D.11-Jan-08 7:21
Monin D.11-Jan-08 7:21 
I am beginner in ASP.Net and have following question:
I have a class and inside of this class i load some information from database.
It is very slow to connect in each instance of this class to database again.
class DataNode
{
    SqlConnection DB;
    public DataNode()
    {
        DB = new SqlConnection("connection string");
        DB.Open();
    }
    public DataNode[] ProcessAllSubNodes()
    {
         // query to get all nodes
         DataNode subNode = new DataNode();
         subNode.GetSomeDataFromDB();
    }
}

I have tried following to avoid it:
1) make SqlConnection DB - static.
Problem: if many users connect simultaniosly - i get error that datareader already used somewhere else.
2) to store DB instance in HttpContext.Current.Session and reuse it each time. It has helped, but i am not sure that it is ideal way and has no bad effects.

I know about caching objects in HttpContext.Cache, but the first time (when there is no cache) it connects to database so often (because my objects are recursive), that database stops responding and i get DB connection timeout exception Frown | :(

So if someone knows a good pattern for my problem, please share Smile | :)

Thanks.
GeneralRe: Asp.Net keeping connection to db Pin
Not Active11-Jan-08 7:55
mentorNot Active11-Jan-08 7:55 
GeneralUnable to send d email in asp.net 2.0 application Pin
Ramya.G11-Jan-08 7:05
Ramya.G11-Jan-08 7:05 
GeneralRe: Unable to send d email in asp.net 2.0 application Pin
Not Active11-Jan-08 7:26
mentorNot Active11-Jan-08 7:26 
GeneralRe: Unable to send d email in asp.net 2.0 application Pin
Ramya.G11-Jan-08 7:39
Ramya.G11-Jan-08 7:39 
GeneralRe: Unable to send d email in asp.net 2.0 application Pin
Not Active11-Jan-08 7:43
mentorNot Active11-Jan-08 7:43 
GeneralRe: Unable to send d email in asp.net 2.0 application Pin
Ramya.G11-Jan-08 7:51
Ramya.G11-Jan-08 7:51 
GeneralRe: Unable to send d email in asp.net 2.0 application Pin
Not Active11-Jan-08 7:57
mentorNot Active11-Jan-08 7:57 
GeneralRe: Unable to send d email in asp.net 2.0 application Pin
Ramya.G11-Jan-08 8:08
Ramya.G11-Jan-08 8:08 
GeneralAutoResponder in asp.net email Pin
aransiola11-Jan-08 5:33
aransiola11-Jan-08 5:33 
GeneralRe: AutoResponder in asp.net email Pin
Ramya.G11-Jan-08 7:26
Ramya.G11-Jan-08 7:26 
Generalshared ssl certificates Pin
eyeseetee11-Jan-08 4:39
eyeseetee11-Jan-08 4:39 
GeneralLabel Value Display Pin
Montu7611-Jan-08 3:14
Montu7611-Jan-08 3:14 
GeneralRe: Label Value Display Pin
sepel11-Jan-08 22:19
sepel11-Jan-08 22:19 
QuestionAre ASP.NET applications browser dependent? Pin
Jats_4ru11-Jan-08 2:01
Jats_4ru11-Jan-08 2:01 
AnswerRe: Are ASP.NET applications browser dependent? Pin
Declan Bright11-Jan-08 2:21
Declan Bright11-Jan-08 2:21 
QuestionHow to apply style for Lable control in render Method Pin
abufaizur11-Jan-08 1:47
abufaizur11-Jan-08 1:47 
QuestionGridView Button field and DOM window Pin
Niya11-Jan-08 1:03
Niya11-Jan-08 1:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.