ASP-No out for a large number of records

I have an ASP page that will query records from a DB table and do some processing and then render the HTML table in the browser. My table contains over 16000 rows. When I run prigram with top 2500 StudId, StudName selection from StudentsTbl, it works fine. But when I use select "StudId, StudName from StudentsTbl" it doesn't show any output. I use Response.flush () after every 50 writes during a loop. Can anyone tell me how to solve this? thanks in advance


Actaully I would create an Excel file from this ASP page by adding Response..ContentType = "application / vnd.ms-excel". I need to generate all data once

-1


source to share


3 answers


Based on your description of the problem, I'm sure you are using IE as your test browser. Response.Flush () will output HTML, but it won't render right away because IE doesn't know how to render the table in stages. Instead, IE expects the entire table to be displayed before pulling it out into the browser window. Your script is not a problem, IE is there.



With that said, I want to point out that your design is fundamentally flawed. Think of your script in terms of usability: there is no good reason why you need to output 16000 lines of data at a time. The page of your recordset in SQL, or limit the recordset to the first 1000 rows using the TOP clause.

+1


source


Try to output it as a table to the browser - I'm sure you are getting the "Script Timed Out" error.



Your best bet would be to increase the timeout interval. You can do it with a little bit of code at the beginning of the script, or you can do it as a global server setting. I would recommend the first one.

0


source


Server.ScriptTimeout = 3939393

put it at the top of the page (I'm just picking a random large number). I am assuming you are getting a timeout from IIS. The default is 90 seconds.

Take away your response.flush, it only slows things down as the server has to output every X ms to the client. Buffer the entire page instead (for best performance should be set to default in IIS).

If it still fails, what is the error? Perhaps your databases are slow.

0


source







All Articles