Thanks for that, I think that might help when I use the dropdown menu to update the page. I'm still getting the problem when loading up the page first time sorry.
Dim sql, dbcomm As Object
Dim Billing As Double
Dim MyConnection As System.Data.Odbc.OdbcConnection
MyConnection = New System.Data.Odbc.OdbcConnection("DSN=2501;UID=dd;PWD=dantheman")
MyConnection.ConnectionTimeout = 0
MyConnection.Open()
sql = "SELECT ""DEPARTMENT-CODE"", "
sql += " Sum( "
sql += " CASE "
sql += " WHEN YEAR = '2011' THEN ""CURR-VALUE"" "
sql += " END) AS CurrentValue "
sql += " FROM PUB.TRTRANS LEFT JOIN PUB.FEETR ON PUB.TRTRANS.""FEE-EARNER"" = PUB.FEETR.""FEE-EARNER"" LEFT JOIN PUB.DEPARTMENT ON PUB.FEETR.DEPARTMENT = PUB.DEPARTMENT.""DEPARTMENT-CODE"" "
sql += " WHERE ( (""ACT-CODE"" = 'BILL' OR ""ACT-CODE"" = 'CN') AND UNDONE = 0 AND ""CURR-VALUE"" > 0 )"
sql += " GROUP BY ""DEPARTMENT-CODE"" "
sql += " HAVING ""DEPARTMENT-CODE"" = '" + fee_earner.SelectedValue + "' "
dbcomm = New System.Data.Odbc.OdbcDataAdapter(sql, MyConnection)
Dim dt As DataTable = New DataTable()
dbcomm.Fill(dt)
MyConnection.Close()
How could I use CommanTimeout, do you think that is whats missing?
Dim sql, dbcomm As Object
Dim Billing As Double
Dim MyConnection As System.Data.Odbc.OdbcConnection
MyConnection = New System.Data.Odbc.OdbcConnection("DSN=2501;UID=dd;PWD=dantheman")
MyConnection.ConnectionTimeout = 0
MyConnection.Open()
Dim cmd As OdbcCommand
cmd = MyConnection.CreateCommand()
sql = "SELECT ""DEPARTMENT-CODE"", "
sql += " Sum( "
sql += " CASE "
sql += " WHEN YEAR = '2011' THEN ""CURR-VALUE"" "
sql += " END) AS CurrentValue "
sql += " FROM PUB.TRTRANS LEFT JOIN PUB.FEETR ON PUB.TRTRANS.""FEE-EARNER"" = PUB.FEETR.""FEE-EARNER"" LEFT JOIN PUB.DEPARTMENT ON PUB.FEETR.DEPARTMENT = PUB.DEPARTMENT.""DEPARTMENT-CODE"" "
sql += " WHERE ( (""ACT-CODE"" = 'BILL' OR ""ACT-CODE"" = 'CN') AND UNDONE = 0 AND ""CURR-VALUE"" > 0 )"
sql += " GROUP BY ""DEPARTMENT-CODE"" "
sql += " HAVING ""DEPARTMENT-CODE"" = '" + fee_earner.SelectedValue + "' "
cmd.CommandText = sql
cmd.CommandTimeout = 80000000
dbcomm = New System.Data.Odbc.OdbcDataAdapter(sql, MyConnection)
Dim dt As DataTable = New DataTable()
dbcomm.Fill(dt)
MyConnection.Close()
danieldunn10
Member
389 Points
383 Posts
Re: Database Timeout
Mar 13, 2012 12:12 PM|LINK
Another error message using a different browser is
Sys.WebForms.PageRequestManagerTimeoutException
Does that help?
Thanks
kedarrkulkar...
All-Star
34545 Points
5554 Posts
Re: Database Timeout
Mar 13, 2012 12:21 PM|LINK
seems, you are using updatepanel on u r page where retriving data...
this makes it as asynchronous operation.... other than query execution time, this async operation of updatepanel is also getting timed out
to avoid this, increast asynchpostbacktimeout of scriptmanager
find the <asp:scriptmanager... > tag on the aspx page and increase this
<asp:ScriptManager AsyncPostBackTimeout="100" ... >
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
danieldunn10
Member
389 Points
383 Posts
Re: Database Timeout
Mar 13, 2012 12:52 PM|LINK
Thanks for that, I think that might help when I use the dropdown menu to update the page. I'm still getting the problem when loading up the page first time sorry.
Dim sql, dbcomm As Object Dim Billing As Double Dim MyConnection As System.Data.Odbc.OdbcConnection MyConnection = New System.Data.Odbc.OdbcConnection("DSN=2501;UID=dd;PWD=dantheman") MyConnection.ConnectionTimeout = 0 MyConnection.Open() sql = "SELECT ""DEPARTMENT-CODE"", " sql += " Sum( " sql += " CASE " sql += " WHEN YEAR = '2011' THEN ""CURR-VALUE"" " sql += " END) AS CurrentValue " sql += " FROM PUB.TRTRANS LEFT JOIN PUB.FEETR ON PUB.TRTRANS.""FEE-EARNER"" = PUB.FEETR.""FEE-EARNER"" LEFT JOIN PUB.DEPARTMENT ON PUB.FEETR.DEPARTMENT = PUB.DEPARTMENT.""DEPARTMENT-CODE"" " sql += " WHERE ( (""ACT-CODE"" = 'BILL' OR ""ACT-CODE"" = 'CN') AND UNDONE = 0 AND ""CURR-VALUE"" > 0 )" sql += " GROUP BY ""DEPARTMENT-CODE"" " sql += " HAVING ""DEPARTMENT-CODE"" = '" + fee_earner.SelectedValue + "' " dbcomm = New System.Data.Odbc.OdbcDataAdapter(sql, MyConnection) Dim dt As DataTable = New DataTable() dbcomm.Fill(dt) MyConnection.Close()How could I use CommanTimeout, do you think that is whats missing?
danieldunn10
Member
389 Points
383 Posts
Re: Database Timeout
Mar 13, 2012 01:51 PM|LINK
I'm now trying
Dim sql, dbcomm As Object Dim Billing As Double Dim MyConnection As System.Data.Odbc.OdbcConnection MyConnection = New System.Data.Odbc.OdbcConnection("DSN=2501;UID=dd;PWD=dantheman") MyConnection.ConnectionTimeout = 0 MyConnection.Open() Dim cmd As OdbcCommand cmd = MyConnection.CreateCommand() sql = "SELECT ""DEPARTMENT-CODE"", " sql += " Sum( " sql += " CASE " sql += " WHEN YEAR = '2011' THEN ""CURR-VALUE"" " sql += " END) AS CurrentValue " sql += " FROM PUB.TRTRANS LEFT JOIN PUB.FEETR ON PUB.TRTRANS.""FEE-EARNER"" = PUB.FEETR.""FEE-EARNER"" LEFT JOIN PUB.DEPARTMENT ON PUB.FEETR.DEPARTMENT = PUB.DEPARTMENT.""DEPARTMENT-CODE"" " sql += " WHERE ( (""ACT-CODE"" = 'BILL' OR ""ACT-CODE"" = 'CN') AND UNDONE = 0 AND ""CURR-VALUE"" > 0 )" sql += " GROUP BY ""DEPARTMENT-CODE"" " sql += " HAVING ""DEPARTMENT-CODE"" = '" + fee_earner.SelectedValue + "' " cmd.CommandText = sql cmd.CommandTimeout = 80000000 dbcomm = New System.Data.Odbc.OdbcDataAdapter(sql, MyConnection) Dim dt As DataTable = New DataTable() dbcomm.Fill(dt) MyConnection.Close()Still not there yet though!
kedarrkulkar...
All-Star
34545 Points
5554 Posts
Re: Database Timeout
Mar 13, 2012 01:54 PM|LINK
set connectiontimeout to some higher value... like 100
MyConnection.ConnectionTimeout = 100
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
danieldunn10
Member
389 Points
383 Posts
Re: Database Timeout
Mar 13, 2012 02:14 PM|LINK
yep, ive tried really high numbers like 100000...
kedarrkulkar...
All-Star
34545 Points
5554 Posts
Re: Database Timeout
Mar 13, 2012 02:26 PM|LINK
I ma referring to ConnectionTimeout... in the last code posted by you, it is 0
Dim MyConnection As System.Data.Odbc.OdbcConnection
MyConnection = New System.Data.Odbc.OdbcConnection("DSN=2501;UID=dd;PWD=dantheman")
MyConnection.ConnectionTimeout = 0
KK
Please mark as Answer if post helps in resolving your issue
My Site
danieldunn10
Member
389 Points
383 Posts
Re: Database Timeout
Mar 19, 2012 12:15 PM|LINK
Hi, I just noticed I had a reply sorry.
In between posts, I was trying many different numbers 0, 100, 1000, 10000, 100000
I couldnt get any of them to work...
Thanks for any advice