Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Timeout expired error while using select

Reply
Thread Tools

Timeout expired error while using select

 
 
Dax
Guest
Posts: n/a
 
      07-20-2006
Hi,
I have a problema of query in an asp page, if I run the query in sql
query analizer is time running it's about 3-4 seconds, if I made the
same query in an asp page it create the error of timeout for the
browser. The result of the query output 2000 of records, all in one
page.

The query is the following:

Legend:
A table ordini_user refer to user
U table utenti refer ti prodoct requested
q table refer to product available


select distinct p.cognome, a.ord_ID, q.prod_id, q.descrip, u.qta
from ordini_user A
join ordini_utenti U on A.ord_id = U.ord_id and u.ord_id like
'62006___'
join utenti p on A.id_user = p.codcliente
and p.cognome like '%Marco%'
join prodotto q on U.prod_id=q.prod_id
order by p.cognome, q.prod_ID

the asp code is the following

Set conn1 = Server.CreateObject("ADODB.Connection")
conn1.open "PROVIDER=SQLOLEDB;DATA
SOURCE=test_sql;UID=test;PWD=blank;DATABASE=Test"
set rs1=Server.CreateObject("ADODB.Recordset")

sql1="select distinct p.cognome, a.ord_ID, q.prod_id, q.descrip, u.qta
" &_
"from ordini_user A "&_
"join ordini_utenti U on A.ord_id = U.ord_id "&_
"and a.ord_id like '"&cod_ordine&"%' "&_
"join utenti p on A.id_user = p.codcliente "&_
"and p.cognome like '%"&fname&"%' join prodotto q on
U.prod_id=q.prod_id "&_
"order by p.cognome, q.prod_ID"

response.write(sql1)

rs1.Open sql1, conn1

do while not rs1.EOF
strtable = strtable & "<tr>" &_
"<td><input type='hidden' name='Cod' value=" & rs1(0)
& "></td>" &_
"<td bgcolor='#D0F1FF'><div align='center'><font
color='#000000'>" & rs1(0) & "</font></div></td>" &_
"<td bgcolor='#D0F1FF'><div align='center'><font
color='#000000'>" & rs1(1) & "</font></div></td>" &_
"<td bgcolor='#D0F1FF'><div align='center'><font
color='#000000'>" & rs1(2) & "</font></div></td>" &_
"<td bgcolor='#D0F1FF'><div align='center'><font
color='#000000'>" & rs1(3) & "</font></div></td>" &_
"<td bgcolor='#D0F1FF'><div align='center'><font
color='#000000'>" & rs1(4) & "</font></div></td>" &_
"</font></tr>"

Ho can I optimize or modify the output source consider that I want to
print all these records?

 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      07-20-2006
Dax wrote:
> Hi,
> I have a problema of query in an asp page, if I run the query in sql
> query analizer is time running it's about 3-4 seconds, if I made the
> same query in an asp page it create the error of timeout for the


What kind of timeout? Script timeout or ADO Command timeout?

It never hurts to copy and paste the entire error message you are receiving,
as well as showing us which line of code is being referred to in the error
message.


> browser. The result of the query output 2000 of records, all in one
> page.
>
> The query is the following:
>
> Legend:
> A table ordini_user refer to user
> U table utenti refer ti prodoct requested
> q table refer to product available
>

<snip>
> do while not rs1.EOF

<snip>

I don't see an rs1.MoveNext statement. Are you sure you haven't created an
infinite loop?

http://www.aspfaq.com/show.asp?id=2366
http://www.aspfaq.com/show.asp?id=2066
http://www.aspfaq.com/show.asp?id=2424
http://www.aspfaq.com/show.asp?id=2120
http://www.aspfaq.com/show.asp?id=2467

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: System.Data.SqlClient.SqlException: Timeout expired. The timeout p Karl Seguin ASP .Net 1 09-04-2007 11:34 AM
/usr/local/lib/ruby/1.8/timeout.rb:54:in `rbuf_fill': execution expired (Timeout::Error) vishnu Ruby 0 05-31-2006 11:08 AM
/usr/local/lib/ruby/1.8/timeout.rb:54:in `rbuf_fill': execution expired (Timeout::Error) vishnu Ruby 0 05-31-2006 11:08 AM
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. Guoqi Zheng ASP .Net 4 06-03-2004 06:39 PM
Re: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Bob Johnson ASP .Net 0 08-07-2003 12:52 PM



Advertisments