Number of connections

  • Thread starter Joe via DotNetMonster.com
  • 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
 
S

Steve C. Orr [MVP, MCSD]

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.
 
J

Joe via DotNetMonster.com

Great, thanks so much. I was afraid I was using too many connection at once
but didn't see a way around it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top