Website Critiques
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignWebsite Critiques

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 16th, 2004, 08:47 AM
cusoxty cusoxty is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 43 cusoxty User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
Help! Why does my page take so long submit!

Hello all. I am looking for help discovering why my form page takes so long to load (roughly a minute). Operationaly, it works great, performing all the tasks I ask it to. The actual page loads fine. However, when the submit button is clicked to enter the data into the database, it takes roughly a minute to process and perform this request. Here is my entire code. Are there any red flags here that are evidently making this page load so slowly? I would appreciate any help!

Code:
<%@ 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=PW;Database=Database"
        Dim return_page as string = "transfers.aspx"
	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."
		
	else


 		lbl_error.text = "Welcome to the Account Transfers Page. Please select an account and the 

territory you wish to transfer to."
            Dim sql as string
             if not Page.IsPostBack then
                 sql =  "select AccountID + ' - ' + AccountName as accnumber from Accounts order by 

AccountName"
    
                 FillDropDownList(sql,AccNumber)
    
             end if
                  
                  if not Page.IsPostBack then
                 sql =  "select distinct territoryName from Territories"
                 FillDropDownList(sql,Toname)
    
             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)
            conn.open()
    
            ' Execute the SQL, Bind the results to the Dropdown List Control
            ddl.DataSource = cmd.ExecuteReader(CommandBehavior.CloseConnection)
            ddl.DataBind()
    
        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
    Cmd1.parameters.add("@AccountID",AccNumber.SelectedItem.Value)
    
    dim cmd2 as SqlCommand
    Cmd2 = New SQLCommand("UpdateToTerritory",Conn)
    'Declare the command type - a stored proc in this case
    Cmd2.commandType = CommandType.storedProcedure
    Cmd2.parameters.add("@AccountID",AccNumber.SelectedItem.Value)
    Cmd2.parameters.add("@ToName",ToName.SelectedItem.Value)
    
    
    conn.open()
    cmd1.ExecuteNonQuery()
    cmd2.ExecuteNonQuery()

    conn.Close()

    Response.redirect(return_page)
     end sub
    
    
        Sub cmdInsert_Click(sender As Object, e As EventArgs)
            InsertData()
        End Sub
    
        Sub cmdCancel_Click(sender As Object, e As EventArgs)
            response.redirect(cancel_page)
        End Sub

</script>
<html>
<head>
    <title>Account Transfers</title>
    <link href="styles.css" type="text/css" rel="stylesheet" />
</head>
<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">
        <tbody>
            <tr bgcolor="#000000">
                <td valign="top" align="left">
                    &nbsp;</td>
            </tr>
            <tr>
                <td width="100%" background="gor_white.bmp">
                    <img height="1" src="images/gor_white.gif" width="20" border="NONE" /></td>
            </tr>
            <tr bgcolor="#002041">
                <td valign="top" align="left" width="100%" height="77">
                    <img height="77" src="images/header.bmp" width="960" /></td>
            </tr>
            <tr>
                <td width="100%" background="gor_white.bmp">
                    <img height="1" src="images/gor_white.bmp" width="20" border="NONE" /></td>
            </tr>
            <tr bgcolor="#36647e">
                <td valign="top" align="left">
                    &nbsp;</td>
            </tr>
            <tr>
                <td valign="center" align="middle" height="98%">
                    <table bordercolor="#5e768e" cellspacing="0" cellpadding="5" width="80%" 

bgcolor="#b6cce4" border="1">
                        <tbody>
                            <tr><td colspan="2" align="center" valign="middle"><asp:Label id="lbl_error" 

runat="server" width="500px" font="verdana" forecolor="#5e768e"></asp:Label></center></td></tr>
                                <td width="400" border="0" valign="top"><br />
                                    <font face="Verdana" size="2"><b>Account Number: </b></font><br />
                                
                                    <asp:DropDownList id="AccNumber" name="AccNumber" runat="server" 

DataValueField="accnumber" DataTextField="AccNumber" Width="400px"></asp:DropDownList>
                                   <br /><br />
				
				     <font face="Verdana" size="2"><b>Transer to:</b></font><br />
                                    <asp:DropDownList id="ToName" name="ToName" runat="server" 

DataValueField="TerritoryName" DataTextField="TerritoryName" Width="215px"></asp:DropDownList><br /><br 

/><br />

<center>                                       

                                            <asp:Button id="cmdInsert" onclick="cmdInsert_Click" 

runat="server" Text="Insert Record" type="submit"></asp:Button>
                                            <asp:Button id="cmdCancel" onclick="cmdCancel_Click" 

runat="server" Text="Cancel"></asp:Button>
                                        </center>

</td><td>
				    <CENTER><IMG SRC="images/login.bmp" width="360" height="270" 

border="0" valign="middle"></CENTER></td>
                            </tr>

                        </tbody>
                    </table>
                </td>
            </tr>
</form>
    <td valign="top" align="middle">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </td></tr>
    <tr>
        <td valign="top" align="middle" colspan="3">
            <hr color="#5e768e" />
        </td>
    </tr>
    <tr>
        <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>
    </tr>

    <tr>
        <td align="CENTER" valign="TOP" bgcolor="#002041">
            <font class="copyright"><font class="copyright_lnk" color="#FFFFFF" face="verdana" 

size="1">Copyright 2000. </font></td>
    </tr>
	</tbody>
	</table>

</body>
</html>



Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignWebsite Critiques > Help! Why does my page take so long submit!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway