Results 1 to 4 of 4

Thread: Speeding up processing time of web page

  1. #1
    Join Date
    Jun 2004

    Speeding up processing time of web page

    Hello. I am having problems with my form web site, for it takes a long time after the submit button is clicked to enter the data into my database. I have run the two stored procedures in query analyzer and they do not take long at all. However, when i use this form on another computer, it seems to work quite fast (Although a debug message appears). By looking at my code, can anyone see any red flags that are causing the process time to be so slow? I would greatly appreciate any help!

    <%@ Page Language="VB" Debug="true" %>
    <%@ import Namespace="System.Data" %>
    <%@ import Namespace="System.Data.SQLClient" %>
    <script runat="server">
        Dim connstr as string = "Server=localhost;UID=User;PWD=Password;Database=Database"
    	Dim cancel_page as string = "bscireal.aspx"
       Sub Page_Load(sender As Object, e As EventArgs)
    	Dim rightNow as DateTime = DateTime.Now
    	If day(RightNow) > 25 Then 
     	lbl_error.text = "You are not able to transfer accounts after the 25th of the month. Please try again next month."
     	lbl_error.text = "Welcome to the Account Transfers Page."
                Dim sql as string
                 if not Page.IsPostBack then
                     sql =  "select AccountID + ' - ' +  AccountName as accnumber from Accounts order by AccountName"
                 end if
                      if not Page.IsPostBack then
                     sql =  "select distinct territoryName from Territories where CloseDate is Null and territoryName not in ('IS 1','IS 2','IS 3','IS 4','IS 5')"
                 end if
        end if
            End Sub
            Sub FillDropDownList(sql as string, ddl as DropDownList)
                ' Create Connection Object, Command Object, Connect to the database
                Dim conn as New SQLConnection(connstr)
                Dim cmd as New SQLCommand(sql,conn)
                ' Execute the SQL, Bind the results to the Dropdown List Control
                ddl.DataSource = cmd.ExecuteReader(CommandBehavior.CloseConnection)
            End Sub
        Sub InsertData()
        Dim conn as SQLConnection
        Conn = New SQLConnection(connstr)
        Dim Cmd1 as SqlCommand
        Cmd1 = New SQLCommand("Insertaccounts",Conn)
        'Declare the command type - a stored proc in this case
        Cmd1.commandType = CommandType.storedProcedure
        'Add the parameters
        dim cmd2 as SqlCommand
        Cmd2 = New SQLCommand("UpdateToTerritory",Conn)
        'Declare the command type - a stored proc in this case
        Cmd2.commandType = CommandType.storedProcedure
         end sub
            Sub cmdInsert_Click(sender As Object, e As EventArgs)
            End Sub
            Sub cmdCancel_Click(sender As Object, e As EventArgs)
            End Sub
        <title>Account Transfers</title>
        <link href="styles.css" type="text/css" rel="stylesheet" />
    <body class="empty" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
           <form onsubmit="return Validate(this)" action="transfers.aspx?Enter=True" method="POST" runat="server" name="form1">
        <table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
                <tr bgcolor="#000000">
                    <td valign="top" align="left">
                    <td width="100%" background="gor_white.gif">
                        <img height="1" src="images/gor_white.gif" width="20" border="NONE" /></td>
                <tr bgcolor="#002041">
                    <td valign="top" align="left" width="100%" height="77">
                        <img height="77" src="images/header.gif" width="960" /></td>
                    <td width="100%" background="gor_white.gif">
                        <img height="1" src="images/gor_white.gif" width="20" border="NONE" /></td>
                <tr bgcolor="#36647e">
                    <td valign="top" align="left">
                    <td valign="center" align="middle" height="98%"><br />
                        <table bordercolor="#5e768e" cellspacing="0" cellpadding="5" width="770" bgcolor="#b6cce4" border="1">
                                <tr><td colspan="2" align="center" valign="middle"><asp:Label id="lbl_error" runat="server" width="500px" font="verdana" font-bold="True" forecolor="#002041"> </asp:Label></center></td></tr>
                                    <td width="440" border="0" valign="top"><br />
                                        <font face="Verdana" size="2"><b>Account: </b></font><br />
                                        <asp:DropDownList id="AccNumber" name="AccNumber" runat="server" DataValueField="accnumber" DataTextField="AccNumber" Width="440px"></asp:DropDownList>
                                       <br /><br />
    				     <font face="Verdana" size="2"><b>Transfer to:</b></font><br />
                                        <asp:DropDownList id="ToName" name="ToName" runat="server" DataValueField="TerritoryName" DataTextField="TerritoryName" Width="220px"></asp:DropDownList><br /><br /><br /><font face="Verdana" size="2"><b>Explanation:</b></font><br />
     <asp:TextBox id="Explanation" TextMode="MultiLine" runat="server" Width="440px" Height="131px"></asp:TextBox><br /><br />
                                                <asp:Button id="cmdInsert" onclick="cmdInsert_Click" runat="server" Text="Request Transfer" type="submit"></asp:Button>
                                                <asp:Button id="cmdCancel" onclick="cmdCancel_Click" runat="server" Text="Cancel"></asp:Button>
    </td><td width="330">
        <td valign="top" align="middle">
            <td valign="top" align="middle" colspan="3">
                <hr color="#5e768e" />
            <td valign="top" align="middle" colspan="3" bgcolor="#002041">
                <font class="text_bold_bl" color="#FFFFFF" face="verdana" size="1">The contents of this site are highly confidential. </font></td>
            <td align="CENTER" valign="TOP" bgcolor="#002041">
                <font class="copyright"><font class="copyright_lnk" color="#FFFFFF" face="verdana" size="1">Copyright 2000.All rights reserved. </font></td>

  2. #2
    Join Date
    Nov 2002
    Auburn, AL
    This is more of a question for the .net forum since you are using asp.net with vb.net. It could be any number of things. The code its self will run fast, its asp.net, it is precompiled and everything by the server. Sql server should be a fast db solution. Are you hosted with other users? Maybe the data base server and the webserver are just under a lot of load. That code is fairly simple, it shouldn't be lagging, its not like you are looping through an actual db table or something (a dataset would still be fast).

  3. #3
    Join Date
    Feb 2003
    Wales, UK
    PM me if you want it moved PeOfEo.
    In a world without walls and fences - who needs Windows and Gates?! - Unknown Author
    "And there's Bill Gates, the...most...famous...man in the...ah...Microsoft." -- A TV commentator for the 2000 Olympics.

    Web Design Faq? | W3C | Validator | Accessibility testing | Speed up your PC | Wura | Box Model Research

  4. #4
    Join Date
    Nov 2002
    Auburn, AL
    It does not bother me that it is here, I was just telling cusoxty a better place for his questions for future reference.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.11177 seconds
  • Memory Usage 2,894KB
  • Queries Executed 13 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (4)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates