OK,
The error states the itemdatabound event on a datagrid, this is the entire
event:(its a lot)
Sub MyDataGrid_onItemDataBound(ByVal sender As Object, ByVal e As
DataGridItemEventArgs)
If (e.Item.ItemType = ListItemType.Item Or _
e.Item.ItemType = ListItemType.AlternatingItem) Then
Dim tracking As String = e.Item.Cells(6).Text
Dim Panel1 As System.Web.UI.WebControls.Panel =
CType(e.Item.FindControl("Panel1"), Panel)
Dim Panel2 As System.Web.UI.WebControls.Panel =
CType(e.Item.FindControl("addPanel"), Panel)
Dim Panel3 As System.Web.UI.WebControls.Panel =
CType(e.Item.FindControl("Notespanel"), Panel)
Dim Statuslabel As System.Web.UI.WebControls.Label =
CType(e.Item.FindControl("lbl_status"), Label)
Dim hyperlink As System.Web.UI.WebControls.HyperLink =
CType(e.Item.FindControl("prop"), HyperLink)
Dim hyperlink2 As System.Web.UI.WebControls.HyperLink =
CType(e.Item.FindControl("add"), HyperLink)
Dim hyperlink3 As System.Web.UI.WebControls.HyperLink =
CType(e.Item.FindControl("notes"), HyperLink)
Dim status As String = e.Item.Cells(7).Text.Trim
Dim calldate As DateTime = CType(e.Item.Cells(1).Text, DateTime)
Dim today As DateTime = DateTime.Now.AddHours(4)
e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor='#99ccff'")
If e.Item.ItemType = ListItemType.Item Then
e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='#ffffff'")
ElseIf e.Item.ItemType = ListItemType.AlternatingItem Then
e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='#D3D3D3'")
End If
'Dim n As Integer
'For n = 3 To 10
e.Item.Cells(5).ToolTip = ("click to open this job in the control panel")
e.Item.Cells(5).Attributes.Add("onmouseover", _
"this.style.backgroundColor='Olive';this.style.cursor='hand';" _
& "window.status='JobID=" & tracking & "'")
'("onclick", "var strReturn;
strReturn=window.showModalDialog('child2.aspx',null,'status:no;dialogWidth:370px;dialogHeight:220px;dialogHide:true;help:no;scroll:no');if
(strReturn != null) document.getElementById('tracking').value=strReturn;")
e.Item.Cells(5).Attributes.Add("onclick", _
"javascript:window.open('http://www.contractorsunlimited.com/ControlPanel/search.aspx?isredirected=true&JobID="
& tracking & "'," _
& "'ControlPanelPage','height=600,width=900,resizeable=yes,scrollbars=2')")
e.Item.Cells(5).Attributes.Add("onmouseout", _
"this.style.backgroundColor='';this.style.cursor='default';" _
& "window.status=''")
'Next
Try
Dim MyConnection2 As SqlClient.SqlConnection
MyConnection2 = New
SqlClient.SqlConnection(ConfigurationSettings.AppSettings("cuall"))
Dim sql As String = "select status_name from callstatus1 " & _
"Join status_by_job on (callstatus1.status_id = status_by_job.status_id) " & _
"where status_by_job.trackingnumber = @variable"
Dim cmd As New SqlCommand(sql, MyConnection2)
cmd.Parameters.Add("@variable", tracking)
Try
It is a lot, I know but the line specified is:
MyConnection2.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader()
If dr.Read() Then
Statuslabel.Text = dr("status_name").ToString()
End If
dr.Close()
Finally
MyConnection2.Close()
End Try
hyperlink3.NavigateUrl = "~/Resources/jobnotes.aspx?var1=" & tracking
hyperlink3.Target = "_blank"
Panel3.Visible = True
hyperlink.NavigateUrl = "~/Tools/prposalfieldrep.aspx?ID=" & tracking
hyperlink.Target = "_blank"
Select Case status
Case "online"
If Statuslabel.Text.Trim = "Approved for Work" Then
Panel1.Visible = True
Else
Panel1.Visible = False
End If
Case Else
Panel1.Visible = False
End Select
If hdnlabelcontrol.Text = "service" Then
Panel2.Visible = False
Dim type As String = e.Item.Cells(12).Text
Select Case type
Case "ASAP"
If DateDiff(DateInterval.Day, calldate, today) > "1" Then
e.Item.ForeColor = System.Drawing.Color.Red
End If
Case "Request"
If DateDiff(DateInterval.Day, calldate, today) > "3" Then
e.Item.ForeColor = System.Drawing.Color.Red
End If
Case Else
If DateDiff(DateInterval.Hour, calldate, today) > "4" Then
e.Item.ForeColor = System.Drawing.Color.Red
End If
End Select
'Dim action As String = e.Item.Cells(13).Text
'e.Item.Cells(13).Attributes.Add("onmouseover", _
' "this.style.backgroundColor='Olive';this.style.cursor='hand';" _
' & "window.status='JobID=" & tracking & "'")
'e.Item.Cells(13).Attributes.Add("onclick", "var strReturn;
strReturn=window.showModalDialog('http://www.contractorsunlimited.com/Tools/child2.aspx?tracking=
& tracking &
',null,'status:no;dialogWidth:370px;dialogHeight:220px;dialogHide:true;help:no;scroll:no');if
(strReturn != null) document.getElementById('action').value=strReturn;")
'e.Item.Cells(13).Attributes.Add("onmouseout", _
' "this.style.backgroundColor='';this.style.cursor='default';" _
' & "window.status=''")
End If
If hdnlabelcontrol.Text = "project" Then
Panel2.Visible = False
End If
If hdnlabelcontrol.Text = "pm" Then
Panel2.Visible = True
hyperlink2.NavigateUrl = "~/Forms/PM/pmadditional.aspx?ID=" & tracking
hyperlink2.Target = "_blank"
End If
Catch ex As Exception
lbl_error.Text = ex.ToString()
Finally
'MyConnection.Close()
End Try
End If
End Sub
Eric Cantrall <[EMAIL PROTECTED]> wrote:
Please post your code for the page that is causing the error. We might be
able to help if we can see what is going on.
It sounds like you are opening a connection to the pool and not closing it
properly.
Connection pooling is a way to speed up your application by using
connections to the database that are already open. Most of the time pool
problems come from a "connection leak" You must manually close all of your
connections. If you don't, then the ADO.Net process must wait for the
Garbage Collector (GC) cleans up the connections. This may take hours in
some cases.
Thanks
--Eric Cantrall
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
-----Original Message-----
From: Eric Throckmorton [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 25, 2005 10:46 AM
To: [email protected]
Subject: RE: [AspNetAnyQuestionIsOk] Timeout expired
DAL (Data Access Layer). OK, makes sense to me. I didn't know what it was
- Database Abstraction Layer is something I remember about when I was
reading php stuff, I don't use it either.
So, what I need to do is free up some connections to the pool. Is using
pooled connections a bad idea? Or am I just leaving too many open... What
DAL code will I need to learn this?
Thank-you
"Falls, Travis D (HTSC, CASD)" <[EMAIL PROTECTED]> wrote:
Sorry DAL is an acronym we use (at least at The Hartford) for Data Access
Layer. Basically it seems when you access your database you are doing it
via a pool and there aren't any free connections in the pool to use. Now I
noticed you mentioned PHP; I am assuming you are coding in .net on this
list... I am no PHP guy that is for sure... java, .Net, Action Script, and
groovy sure... PHP nope. ;-)
Travis D. Falls | Consultant RAFT.Net IT | 860.547.4070 |
[EMAIL PROTECTED]
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 25, 2005 9:52 AM
To: [email protected]
Subject: RE: [AspNetAnyQuestionIsOk] Timeout expired
I'd be glad to. Do you know where I can find this DAL code? I do not
recall any php in my coding so this must be generated some other way. Let
me know and will post it so you can see what me be happening. Thank-you.
"Falls, Travis D (HTSC, CASD)" <[EMAIL PROTECTED]> wrote:It looks
like you are trying to grab a connection out of a connection pool and they
are all being used and that the attempt to get a connection is timing out.
Post some of your DAL code and we can try to see what's going on.
Travis D. Falls | Consultant RAFT.Net IT | 860.547.4070 |
[EMAIL PROTECTED]
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 25, 2005 9:22 AM
To: [email protected]
Subject: [AspNetAnyQuestionIsOk] Timeout expired
Can someone please tell me how to debug this error?:
System.InvalidOperationException: 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. at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection
(SqlConnectionString options, Boolean& isInTransaction) at
System.Data.SqlClient.SqlConnection.Open() at...
Thank-you
Yahoo! Groups Links
*************************************************************************
This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information. If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited. If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*************************************************************************
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "AspNetAnyQuestionIsOk" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.
[Non-text portions of this message have been removed]
Yahoo! Groups Links
SPONSORED LINKS
Basic programming language Computer programming languages Programming
languages Java programming language
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "AspNetAnyQuestionIsOk" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.
[Non-text portions of this message have been removed]
_____
YAHOO! GROUPS LINKS
* Visit your group "AspNetAnyQuestionIsOk
<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]
e>
* Your use of Yahoo! Groups is subject to the Yahoo!
<http://docs.yahoo.com/info/terms/> Terms of Service.
_____
[Non-text portions of this message have been removed]
SPONSORED LINKS
Basic programming language Computer programming languages Programming languages
Java programming language
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "AspNetAnyQuestionIsOk" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/