When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles
Message Board
Related Web Technologies
User Tips!
Coding Tips

Sample Chapters
Commonly Asked Message Board Questions
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Stump the SQL Guru!
XML Info
Author an Article
ASP ASP.NET ASP FAQs Message Board Feedback
Print this page.
Published: Thursday, June 22, 2000

Using Sql Server 7 Web Assistant to Improve performance of Asp Pages, Part 2

By Venkatraman Ambethkar

  • Read Part 1

  • In Part 1 we looked at running the SQL Server 7 Web Assistant Wizard to create an HTML file with the database information, output.html. In this part we'll examine how to display this HTML file in the combo box on our ASP page!

    - continued -

    Step3: Including the generated html in our ASP files wherever necessary
    Start by opening your HTML editor and creating a new ASP page. We want to use a server-side include to import the contents of output.html. Therefore, add <!-include file="output.html"--> to the file. Now save this file as Display.asp in your virtual directory. The code for this sample file could be as follows.

        <!-- #include file="output.html"-->

    (To learn more about server-side includes be sure to read: The Low-Down on #include.)

    Now, request the Display.asp from your browser, you should get the drop down box! You can insert, update or delete a row in the jobs table and refresh the browser, you will get the drop down duly updated. Neat, eh?

    As you can see, the coding that we have done is only for the Template.tpl, which can also be used for several other jobs which produce drop down boxes from other tables. The rest of the work is only selecting things in the wizard. Even for creating the stored procedure (sp_makewebtask) which does all the work, we can use the wizard and use the code generated by the wizard.

    Comparison of Performance Test
    In order to give you a clear picture of the advantages of using HTML files over asp pages with database connection, I wrote another asp file which does exactly the same but using ADO Recordset whose code is as given below,

      dim oConn,rs
      set oConn=server.createobject("adodb.connection")
      oConn.open "DRIVER={SQL Server};SERVER=Nana;" & _
      set rs=oConn.execute("select job_id,job_desc from jobs")
      if not rs.eof then
        response.write("<form><select name='cboJobs'>")
        do while not rs.eof 
          response.write("<option value="& rs(0) &">"& rs(1))
      end if
      set rs=nothing
      set conn=nothing

    and carried out tests using Microsoft-Web Application stress Tool on both these files. Here is the tally.

    Test CriteriaWith include fileWith Database Connection
    Threads = Stress Level * Stress Multiplier 100 = 10*10100 = 10*10
    Duration Of Test1 min 1 min
    Number of Hits12,9812,382
    Requests Per Second216.01 39.65
    TTFB (Total Time for First Byte) in sec 0.451 secs 2.252 secs
    TTLB (Total Time for Last Byte) in secs0.455.79 secs2.455 secs

    From the TTFB values, you can see how faster the file with include is.

    Happy Programming.

  • Venkatraman Ambethkar

  • ASP.NET [1.x] [2.0] | ASPFAQs.com | Advertise | Feedback | Author an Article