Database Timeouthttp://forums.asp.net/t/1779717.aspx/1?Database+TimeoutMon, 19 Mar 2012 12:15:17 -040017797174877167http://forums.asp.net/p/1779717/4877167.aspx/1?Database+TimeoutDatabase Timeout <p>Hi, I have a sql query which works fine with one table, when I join two more tables to the query it comes up with this error though.<br> <br> ERROR [HYT00] [DataDirect][ODBC Progress OpenEdge Wire Protocol driver]Timeout expired.<br> ERROR [HY000] [DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Query aborted on user request (7495)&quot;<br> <br> It does work sometimes though, I dont think its a problem with the query. It just because the time taken to go run the query takes longer than a setting somewhere.<br> <br> Ive tried changing the ODBC timeout settings on my PC and the driver on the server which didnt work<br> <br> When I run the exact same query in MS Access it works fine<br> <br> Thanks for any advice<br> <br> </p> 2012-03-13T09:42:05-04:004877196http://forums.asp.net/p/1779717/4877196.aspx/1?Re+Database+TimeoutRe: Database Timeout <p>hi</p> <p></p> <p>Can you please share the query which generates error ?</p> 2012-03-13T09:54:51-04:004877209http://forums.asp.net/p/1779717/4877209.aspx/1?Re+Database+TimeoutRe: Database Timeout <p>try increasing connection and command timeout</p> <p>Connection.Connection<span class="search-highlight">Timeout</span> = <span class="code-digit"> 30</span><br> Connection.Command<span class="search-highlight">Timeout</span> = <span class="code-digit"> 80</span></p> <p><span class="code-digit">timeout value in second here </span></p> <p><span class="code-digit">hope this helps...</span></p> 2012-03-13T10:00:47-04:004877234http://forums.asp.net/p/1779717/4877234.aspx/1?Re+Database+TimeoutRe: Database Timeout <p>Thanks KK, I get this error now!</p> <h2><i>ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed</i></h2> <p>I will post my Query in a moment</p> <p>Thank You</p> 2012-03-13T10:10:50-04:004877250http://forums.asp.net/p/1779717/4877250.aspx/1?Re+Database+TimeoutRe: Database Timeout <pre class="prettyprint">Dim sql, dbcomm As Object Dim Billing As Double Dim MyConnection As System.Data.Odbc.OdbcConnection MyConnection = New System.Data.Odbc.OdbcConnection(&quot;DSN=2501;DB=sosdb;UID=dd;PWD=dantheman;HOST=newfileserver;PORT=2511&quot;) 'MyConnection.ConnectionTimeout = 80 MyConnection.Open() sql = &quot;SELECT &quot;&quot;DEPARTMENT-DESCRIPTION&quot;&quot;, &quot; sql &#43;= &quot; Sum( &quot; sql &#43;= &quot; CASE &quot; sql &#43;= &quot; WHEN &quot;&quot;POST-DATE&quot;&quot; BETWEEN CURDATE()-365 AND CURDATE() THEN &quot;&quot;CURR-VALUE&quot;&quot; &quot; sql &#43;= &quot; END) AS CurrentValue &quot; sql &#43;= &quot; FROM (PUB.TRTRANS LEFT JOIN PUB.FEETR ON PUB.TRTRANS.&quot;&quot;FEE-EARNER&quot;&quot; = PUB.FEETR.&quot;&quot;FEE-EARNER&quot;&quot;) LEFT JOIN PUB.DEPARTMENT ON PUB.FEETR.DEPARTMENT = PUB.DEPARTMENT.&quot;&quot;DEPARTMENT-CODE&quot;&quot; &quot; sql &#43;= &quot; WHERE ( (&quot;&quot;ACT-CODE&quot;&quot; = 'BILL' OR &quot;&quot;ACT-CODE&quot;&quot; = 'CN') AND UNDONE = 0 AND &quot;&quot;DEPARTMENT-DESCRIPTION&quot;&quot; = '&quot; &#43; fee_earner.SelectedValue &#43; &quot;' AND &quot;&quot;CURR-VALUE&quot;&quot; &gt; 0 )&quot; sql &#43;= &quot; GROUP BY &quot;&quot;DEPARTMENT-DESCRIPTION&quot;&quot; &quot; dbcomm = New System.Data.Odbc.OdbcDataAdapter(sql, MyConnection) Dim dt As DataTable = New DataTable() dbcomm.Fill(dt) MyConnection.Close()</pre> <p></p> <p>I've tried taking the brackets out of the FROM clause which works on other queries but i get the same thing</p> <p>This is a picture of the join in Access which works - <a target="_blank" href="https://skydrive.live.com/redir.aspx?cid=9c2775bd3b48974e&amp;resid=9C2775BD3B48974E!116&amp;parid=9C2775BD3B48974E!114"> https://skydrive.live.com/redir.aspx?cid=9c2775bd3b48974e&amp;resid=9C2775BD3B48974E!116&amp;parid=9C2775BD3B48974E!114</a></p> <p>Thanks</p> 2012-03-13T10:18:54-04:004877309http://forums.asp.net/p/1779717/4877309.aspx/1?Re+Database+TimeoutRe: Database Timeout <p>have u created the DSN on u r machine? is it named 2501? seems there is issue with coneection string... check this</p> <p><a href="http://www.connectionstrings.com/dsn">http://www.connectionstrings.com/dsn</a></p> <p>hope this helps...</p> 2012-03-13T10:45:36-04:004877335http://forums.asp.net/p/1779717/4877335.aspx/1?Re+Database+TimeoutRe: Database Timeout <p>The DSN is on the server where the files are in IIS.</p> <p>Yep the DSN name is 2501</p> <p>I've used that connection string in many other apps to connect to the database. Sould I change it?</p> <p>Thanks</p> 2012-03-13T10:55:56-04:004877358http://forums.asp.net/p/1779717/4877358.aspx/1?Re+Database+TimeoutRe: Database Timeout <p>I've got the page to load for the first time using this!!</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyConnection = New System.Data.Odbc.OdbcConnection(&quot;DSN=2501;UID=dd;PWD=dantheman&quot;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyConnection.ConnectionTimeout = 80</p> <p>I will check to see if it works when I change the rest</p> <p>Thanks very much!</p> 2012-03-13T11:04:28-04:004877405http://forums.asp.net/p/1779717/4877405.aspx/1?Re+Database+TimeoutRe: Database Timeout <p></p> <blockquote><span class="icon-blockquote"></span> <h4>danieldunn10</h4> <p></p> <p>I've got the page to load for the first time using this!!</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyConnection = New System.Data.Odbc.OdbcConnection(&quot;DSN=2501;UID=dd;PWD=dantheman&quot;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyConnection.ConnectionTimeout = 80</p> <p></p> </blockquote> <p></p> <p>do u mean it is working now? or still same issue</p> 2012-03-13T11:23:22-04:004877467http://forums.asp.net/p/1779717/4877467.aspx/1?Re+Database+TimeoutRe: Database Timeout <p>I think i still have the problem sorry</p> <p>It does work if you refresh the page 5 or 6 times.</p> <p>It seems to work sometimes and others not!?</p> <p>Thank you</p> 2012-03-13T11:47:39-04:004877526http://forums.asp.net/p/1779717/4877526.aspx/1?Re+Database+TimeoutRe: Database Timeout <p>Another error message using a different browser is</p> <h1 class="title">Sys.WebForms.PageRequestManagerTimeoutException</h1> <p>Does that help?</p> <p>Thanks </p> 2012-03-13T12:12:50-04:004877558http://forums.asp.net/p/1779717/4877558.aspx/1?Re+Database+TimeoutRe: Database Timeout <p>seems, you are using updatepanel on u r page where retriving data...</p> <p>this makes it as asynchronous operation.... other than query execution time, this async operation of updatepanel is also getting timed out</p> <p>to avoid this, increast asynchpostbacktimeout of scriptmanager</p> <p>find the &lt;asp:scriptmanager... &gt; tag on the aspx page and increase this</p> <p>&lt;asp:ScriptManager <strong>AsyncPostBackTimeout=&quot;100&quot;</strong> ... &gt;</p> <p>hope this helps...</p> 2012-03-13T12:21:44-04:004877642http://forums.asp.net/p/1779717/4877642.aspx/1?Re+Database+TimeoutRe: Database Timeout <p>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.</p> <p></p> <pre class="prettyprint">Dim sql, dbcomm As Object Dim Billing As Double Dim MyConnection As System.Data.Odbc.OdbcConnection MyConnection = New System.Data.Odbc.OdbcConnection(&quot;DSN=2501;UID=dd;PWD=dantheman&quot;) MyConnection.ConnectionTimeout = 0 MyConnection.Open() sql = &quot;SELECT &quot;&quot;DEPARTMENT-CODE&quot;&quot;, &quot; sql &#43;= &quot; Sum( &quot; sql &#43;= &quot; CASE &quot; sql &#43;= &quot; WHEN YEAR = '2011' THEN &quot;&quot;CURR-VALUE&quot;&quot; &quot; sql &#43;= &quot; END) AS CurrentValue &quot; sql &#43;= &quot; FROM PUB.TRTRANS LEFT JOIN PUB.FEETR ON PUB.TRTRANS.&quot;&quot;FEE-EARNER&quot;&quot; = PUB.FEETR.&quot;&quot;FEE-EARNER&quot;&quot; LEFT JOIN PUB.DEPARTMENT ON PUB.FEETR.DEPARTMENT = PUB.DEPARTMENT.&quot;&quot;DEPARTMENT-CODE&quot;&quot; &quot; sql &#43;= &quot; WHERE ( (&quot;&quot;ACT-CODE&quot;&quot; = 'BILL' OR &quot;&quot;ACT-CODE&quot;&quot; = 'CN') AND UNDONE = 0 AND &quot;&quot;CURR-VALUE&quot;&quot; &gt; 0 )&quot; sql &#43;= &quot; GROUP BY &quot;&quot;DEPARTMENT-CODE&quot;&quot; &quot; sql &#43;= &quot; HAVING &quot;&quot;DEPARTMENT-CODE&quot;&quot; = '&quot; &#43; fee_earner.SelectedValue &#43; &quot;' &quot; dbcomm = New System.Data.Odbc.OdbcDataAdapter(sql, MyConnection) Dim dt As DataTable = New DataTable() dbcomm.Fill(dt) MyConnection.Close()</pre> <p>How could I use CommanTimeout, do you think that is whats missing?</p> 2012-03-13T12:52:26-04:004877784http://forums.asp.net/p/1779717/4877784.aspx/1?Re+Database+TimeoutRe: Database Timeout <p>I'm now trying</p> <pre class="prettyprint">Dim sql, dbcomm As Object Dim Billing As Double Dim MyConnection As System.Data.Odbc.OdbcConnection MyConnection = New System.Data.Odbc.OdbcConnection(&quot;DSN=2501;UID=dd;PWD=dantheman&quot;) MyConnection.ConnectionTimeout = 0 MyConnection.Open() Dim cmd As OdbcCommand cmd = MyConnection.CreateCommand() sql = &quot;SELECT &quot;&quot;DEPARTMENT-CODE&quot;&quot;, &quot; sql &#43;= &quot; Sum( &quot; sql &#43;= &quot; CASE &quot; sql &#43;= &quot; WHEN YEAR = '2011' THEN &quot;&quot;CURR-VALUE&quot;&quot; &quot; sql &#43;= &quot; END) AS CurrentValue &quot; sql &#43;= &quot; FROM PUB.TRTRANS LEFT JOIN PUB.FEETR ON PUB.TRTRANS.&quot;&quot;FEE-EARNER&quot;&quot; = PUB.FEETR.&quot;&quot;FEE-EARNER&quot;&quot; LEFT JOIN PUB.DEPARTMENT ON PUB.FEETR.DEPARTMENT = PUB.DEPARTMENT.&quot;&quot;DEPARTMENT-CODE&quot;&quot; &quot; sql &#43;= &quot; WHERE ( (&quot;&quot;ACT-CODE&quot;&quot; = 'BILL' OR &quot;&quot;ACT-CODE&quot;&quot; = 'CN') AND UNDONE = 0 AND &quot;&quot;CURR-VALUE&quot;&quot; &gt; 0 )&quot; sql &#43;= &quot; GROUP BY &quot;&quot;DEPARTMENT-CODE&quot;&quot; &quot; sql &#43;= &quot; HAVING &quot;&quot;DEPARTMENT-CODE&quot;&quot; = '&quot; &#43; fee_earner.SelectedValue &#43; &quot;' &quot; 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()</pre> <p>Still not there yet though!</p> <p></p> 2012-03-13T13:51:18-04:004877795http://forums.asp.net/p/1779717/4877795.aspx/1?Re+Database+TimeoutRe: Database Timeout <p>&nbsp;set connectiontimeout to some higher value... like 100</p> <p><span class="typ">MyConnection</span><span class="pun">.</span><span class="typ">ConnectionTimeout</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> 100</span><span class="pln">&nbsp;</span></p> <p><span class="pln">hope this helps...<br> </span></p> 2012-03-13T13:54:32-04:004877840http://forums.asp.net/p/1779717/4877840.aspx/1?Re+Database+TimeoutRe: Database Timeout <p>yep, ive tried really high numbers like 100000...</p> 2012-03-13T14:14:10-04:004877865http://forums.asp.net/p/1779717/4877865.aspx/1?Re+Database+TimeoutRe: Database Timeout <p>I ma referring to ConnectionTimeout... in the last code posted by you, it is 0</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="typ">Dim</span><span class="pln"> </span><span class="typ">MyConnection</span><span class="pln"> </span><span class="typ">As</span><span class="pln"> </span><span class="typ">System</span><span class="pun">.</span><span class="typ">Data</span><span class="pun">.</span><span class="typ">Odbc</span><span class="pun">.</span><span class="typ">OdbcConnection</span><span class="pln">&nbsp;<br> &nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="typ">MyConnection</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="typ">New</span><span class="pln"> </span><span class="typ">System</span><span class="pun">.</span><span class="typ">Data</span><span class="pun">.</span><span class="typ">Odbc</span><span class="pun">.</span><span class="typ">OdbcConnection</span><span class="pun">(</span><span class="str">&quot;DSN=2501;UID=dd;PWD=dantheman&quot;</span><span class="pun">)</span><span class="pln">&nbsp;<br> &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="typ">MyConnection</span><span class="pun">.</span><span class="typ">ConnectionTimeout</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pln">&nbsp;<br> </span></p> <p><span class="pln"></span>&nbsp;</p> <p><span class="pln"></span></p> 2012-03-13T14:26:39-04:004887396http://forums.asp.net/p/1779717/4887396.aspx/1?Re+Database+TimeoutRe: Database Timeout <p>Hi, I just noticed I had a reply sorry.</p> <p>In between posts, I was trying many different numbers 0, 100, 1000, 10000, 100000</p> <p>I couldnt get any of them to work...</p> <p>Thanks for any advice</p> 2012-03-19T12:15:17-04:00