Why not? As long as you close each connection after you are done with it, it
will be fine (unless we are talking many many connections).
You can also do some things like have a base page with a connection property
exposed, and then have all your user controls get the current page's
connection via this property.
"Paul" <> wrote in message
news

020B564-4E8C-489C-90D5-...
>I have a .aspx site.
>
> I have a header that I want on the entire site. So I made it a User
> Control
> .ascx file. In this header, I make one SQL call, so I need to create all
> the
> connection objects, etc.
>
> So I embed that User Control in the .ascx file. No problem.
>
> The problem is I have to make another SQL call in the .aspx file. But it
> appears that I can not use the same connection object that I declared in
> the
> .ascx file.
>
> I do not want to create multiple connection object for each page.
>
> Is there a proper way to do this considering the requirements? Maybe use a
> code-behind. I only want to create one connection object per page.