Number of connections

  • Thread starter Thread starter Joe via DotNetMonster.com
  • Start date Start date
J

Joe via DotNetMonster.com

Hi,

When I bring up a page, 6 connections are created. Is this too much?

What I have is a header in a usercontrol that uses a class function. Then
this class function is bound to two repeater control on the page.

<ASP:Repeater id="RepeaterPageText" runat="server" DataSource="<%#
Data.dataClass.GetProd() %>">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "ProdName") %>
</ItemTemplate>
</ASP:Repeater>

I then have a footer that also is in a usercontrol that has 3 connections
to the database.

Everytime a different repeater is bound to a datasource is it creating a
new connection? Can I just call the function once?

Thanks

Thanks
 
ADO.NET has built in connection pooling, so it's really fairly efficient,
actually.
Assuming you're "opening" each connection just before you use it, and you
"close" each connection right after you're done with it, ADO.NET is probably
only actually using one database connection behind the scenes, not 6.
 
Great, thanks so much. I was afraid I was using too many connection at once
but didn't see a way around it.
 
Back
Top