.net 1.1, open connections in nested repeaters

G

Guest

Hi,

I have nested repeaters. But the page breaks if I refresh 2 or 3 times. It
breaks with the following error message..
"Timeout expired. The timeout period elapsed prior to obtaining a connection
from the pool. This may have occurred because all pooled connections were in
use and max pool size was reached. "

I am using the following lines for loading data in the child repeaters on
Item_DataBound of Parent Repeater.

using (SqlConnection oConn = new SqlConnection(ConnectionStrings.Portal))
{
SqlCommand oCmd = new SqlCommand(strSql, oConn);
oConn.Open();
SqlDataReader cmDataReader = oCmd.ExecuteReader();
Repeater tempRepeater = (Repeater) rItem.FindControl("_childRepeater");
if (tempRepeater != null)
{
tempRepeater.DataSource = cmDataReader;
tempRepeater.DataBind();
}
cmDataReader.Close();
oCmd.Dispose();
}

What am I doing wrong?
 

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
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top