Re: ADO Connection object in Session_OnEnd
From: Agoston Bejo (gusz1_at_freemail.hu)
Date: 09/24/04
- Next message: Bob Barrows [MVP]: "Re: ADO Connection object in Session_OnEnd"
- Previous message: Agoston Bejo: "Re: ADO Connection object in Session_OnEnd"
- In reply to: Bob Barrows [MVP]: "Re: ADO Connection object in Session_OnEnd"
- Next in thread: Bob Barrows [MVP]: "Re: ADO Connection object in Session_OnEnd"
- Reply: Bob Barrows [MVP]: "Re: ADO Connection object in Session_OnEnd"
- Reply: Aaron [SQL Server MVP]: "Re: ADO Connection object in Session_OnEnd"
- Reply: Bob Barrows [MVP]: "Re: ADO Connection object in Session_OnEnd"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 24 Sep 2004 15:45:14 +0200
"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:Oz2Y$sjoEHA.1992@TK2MSFTNGP09.phx.gbl...
> Agoston Bejo wrote:
> > "Roji. P. Thomas" <lazydragon@nowhere.com> wrote in message
> > news:e%23QppljoEHA.3428@TK2MSFTNGP11.phx.gbl...
> >>> A Conn object is created the same way in Session_OnStart and is used
> >>> throughout the application
> >
> >>
> >> O, Boy thats a bad idea
> >
> > Yeah, yeah, I think I know what you mean,
>
> Maybe you do, but your next statement makes me doubt it.
>
> > but as far as I know, it's
> > not that bad idea if you close the connection at the end of every asp
> > page and reopen it at the beginning of them.
> >
> Then what's the point of opening it in Session_OnStart? Maybe you misspoke
> in your earlier message. When you said " ... and is used throughout the
> application", were you talking about the connection object (bad) or the
> connection string (good)?
It isn't opened in Session_OnStart.
In Session_OnEnd I open it only because I create a new Connection object.
(That part --"Conn.Open"-- doesn't come from Session_OnStart, all right.)
Actually, the connection object is put into a Session variable, and is
reopened and closed every time an asp page is processed.
>From what you (and the others) say, it shouldn't be done this way, and I
should create a new Connection object in every asp page. Right?
Anyway, the original problem has not much to do with this, so let's now
concentrate on that part. (Why doesn't the newly created Connection
object --initialized with a valid connection string-- work in
Session_OnEnd?)
Thx
>
> Bob Barrows
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>
- Next message: Bob Barrows [MVP]: "Re: ADO Connection object in Session_OnEnd"
- Previous message: Agoston Bejo: "Re: ADO Connection object in Session_OnEnd"
- In reply to: Bob Barrows [MVP]: "Re: ADO Connection object in Session_OnEnd"
- Next in thread: Bob Barrows [MVP]: "Re: ADO Connection object in Session_OnEnd"
- Reply: Bob Barrows [MVP]: "Re: ADO Connection object in Session_OnEnd"
- Reply: Aaron [SQL Server MVP]: "Re: ADO Connection object in Session_OnEnd"
- Reply: Bob Barrows [MVP]: "Re: ADO Connection object in Session_OnEnd"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|