Solved

Webform slow to update from database.

Posted on 2011-02-14
5
449 Views
Last Modified: 2012-05-11
I've got a web form with a RadioButtonList for filtering records, a DropDownList for selecting a single record and then a FormView to display the selected record.

The database is not large.  Less than 5000 records in the large table and only a few hundred records in a couple of related tables.  It takes about six seconds to make any filter change or for any selected record to show up in the FormView, then about six seconds again to go from ItemTemplate view to EditTemplate view.  I am using stored procedures for the Select and Update SQL statements.

Does that sound normal?  It seems painfully slow.

I have clusterd indexes set on the primary keys of the tables.

Are there some "Best Practices" or hints that might help me make this thing more responsive.  I'm not an expert and I'm still going to the school of hard knocks for SQL Server and ASP.Net programming in general.  Some suggestions or things to look for would really be appreciated.

I attached my markup and code in case anyone wants to take a look and see if I did something stupid like make redundant database reads or just not doing it effeciently.
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.UI.WebControls
Imports System.Web.UI.Page

Partial Class Applicant_Verification
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Session("MonitorID") Is Nothing Then
            Response.Redirect("http://www.wf1broward.com/Applicant_Verification_Login.aspx")
            '    FormView1.Enabled = False
            'Else
            '    FormView1.Enabled = True
        End If

        lblUserName.Text = "Logged in as: " & Session("MonitorID") & "  <br /> Editing Record: " & DropDownList1.SelectedValue.ToString
        If DropDownList1.SelectedValue Is Nothing Then
            FormView1.Enabled = False
        Else
            FormView1.Enabled = True
        End If
        'If Not Page.IsPostBack Then
        '    Dim saveButton As Button = CType(FormView1.FindControl("updatebutton"), Button)
        '    Dim verifiedCheckBox As CheckBox = CType(FormView1.FindControl("CheckBox1"), CheckBox)
        '    If verifiedCheckBox.Checked = False Then
        '        saveButton.Enabled = False
        '    Else
        '        saveButton.Enabled = True
        '    End If
        'End If
        ' Crap --------------------
        'If FormView1.CurrentMode = FormViewMode.ReadOnly Then
        '    Dim StatusLabel As Label = CType(FormView1.FindControl("Status"), Label)
        '    Dim StatusImage As Image = CType(FormView1.FindControl("Image1"), Image)
        '    If StatusLabel.Text = "1" Then
        '        StatusImage.ImageUrl = "~/images/StatusGreen.png"
        '    ElseIf StatusLabel.Text = "2" Then
        '        StatusImage.ImageUrl = "~/images/StatusYellow.png"
        '    ElseIf StatusLabel.Text = "3" Then
        '        StatusImage.ImageUrl = "~/images/StatusRed.png"
        '    Else
        '        StatusImage.ImageUrl = "~/images/arrow007.gif"
        '    End If
        'End If

        'Session("MonitorID") = Session("MonitorID")

        'Response.Write("Current Session timeout value is " & Session.Timeout & " minutes.")


    End Sub

    Protected Sub UpdateButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        'Call SendMonitorIDToApplicants()
        Call RunStoredProcedures()
    End Sub

    Protected Sub SendMonitorIDToApplicants()
        '|----------------------------------------------------------------------|
        '| Add MonitorID to Applicants Table "LastEditedBy" field               |
        '|                                                                      |
        '|----------------------------------------------------------------------|

        Dim DBConn As New SqlConnection("UID=dmegnin;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=SYEP2007;Data Source=BETASERVE;Packet Size=4096;")
        Dim DBCmd As New SqlCommand
        Dim DBAdap As New SqlDataAdapter
        'Dim DS As New DataSet   ' It doesn't look like I'm using a DataSet anywhere. ????
        DBConn.Open()

        Try
            'Add Insert Statement 
            'DBCmd = New SqlCommand("SET NOCOUNT ON; INSERT INTO JobTitles(keyWorksiteID,keyEmployerID,txtWorksiteJobTitle,txtWorksiteJobTitlePositionsNumber,ddlDressCode,ddlIndoorOutdoor,ddlWorkHours,cbWeekdays,cbSaturdays,cbSundays,ddlBackgroundCheck,txtJobDescriptionPrim1,txtJobDescriptionPrim2,txtJobDescriptionPrim3,txtJobDescriptionPrim4,txtJobDescriptionPrim5,txtJobDescriptionSec1,txtJobDescriptionSec2,txtJobDescriptionSec3,txtJobDescriptionSec4,txtJobDescriptionSec5,ApplicationDatePosition) VALUES (@txtForeignKeyPosWorksiteID,@txtForeignKeyPosEmployerID,@txtWorksiteJobTitle,@txtWorksiteJobTitlePositionsNumber,@ddlDressCode,@ddlIndoorOutdoor,@ddlWorkHours,@cbWeekdays,@cbSaturdays,@cbSundays,@ddlBackgroundCheck,@txtJobDescriptionPrim1,@txtJobDescriptionPrim2,@txtJobDescriptionPrim3,@txtJobDescriptionPrim4,@txtJobDescriptionPrim5,@txtJobDescriptionSec1,@txtJobDescriptionSec2,@txtJobDescriptionSec3,@txtJobDescriptionSec4,@txtJobDescriptionSec5,GetDate()); Select SCOPE_IDENTITY()", DBConn)
            DBCmd = New SqlCommand("UPDATE Applicants SET(LastUpdatedBy, DateUpdated) VALUES (@LastUpdatedBy, getdate())", DBConn)
            'Add Database Parameters
            'keyApplicantIDLabel1
            'DBCmd.Parameters.Add("@txtPriKeyPositionID", SqlDbType.Int).Value = txtPriKeyPositionID.Text
            'DBCmd.Parameters.Add("@LastUpdatedBy", SqlDbType.VarChar).Value = Session("MonitorID").ToString()
            DBCmd.Parameters.Add("@LastUpdatedBy", SqlDbType.VarChar).Value = Session("MonitorID").ToString()
            'DBCmd.Parameters.Add("@txtForeignKeyPosEmployerID", SqlDbType.Int).Value = Session("eKey").ToString() ' txtForeignKeyPosEmployerID.Text
            DBCmd.ExecuteNonQuery()
            'Dim priKeyJobTitles As Integer = DBCmd.ExecuteScalar()

            'Response.Write(priKeyJobTitles)
            'Cache("jKey") = priKeyJobTitles.ToString  'I don't know if I'll need this.  Maybe for a Confirmation Page?

        Catch exp As Exception
            Response.Write(exp)
        End Try

        'Close Database connection 
        'and Dispose Database objects 
        DBCmd.Dispose()
        DBAdap.Dispose()
        DBConn.Close()
        DBConn = Nothing
    End Sub

    Protected Sub RunStoredProcedures()
        'Run stored procedures to update JobTitles with current Employer Name, Worksite Name, City, Zip, Positions Available and Positions Taken

        'Dim sConnStr As String = "UID=dmegnin;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=SYEP2007;Data Source=BETASERVE;Packet Size=4096;"
        'Try using this to point to the connection string in the web.config.  Then it only needs to be changed in one place.
        'ConfigurationManager.ConnectionStrings["SYEP2007ConnectionString1"].ConnectionString
        Dim sConnStr As String = ConfigurationManager.ConnectionStrings("SYEP2007ConnectionString1").ConnectionString

        Dim cnBKTest As New SqlConnection(sConnStr)
        Dim cmdTest As New SqlCommand("sp_Update_Applicants_MonitorLastUpdated", cnBKTest)
        ' See here for how to run a collection of stored procedures
        ' http://www.dotnetjunkies.ddj.com/Article/9AE62C44-3841-4687-B906-2F6D4A5A4622.dcik

        cmdTest.CommandType = Data.CommandType.StoredProcedure

        cmdTest.Parameters.Add(New SqlParameter("@MonitorID", Data.SqlDbType.VarChar, 50))
        cmdTest.Parameters("@MonitorID").Value = Session("MonitorID").ToString()

        cmdTest.Parameters.Add(New SqlParameter("@keyApplicantID", Data.SqlDbType.VarChar, 10))
        cmdTest.Parameters("@keyApplicantID").Value = DropDownList1.SelectedValue.ToString

        cnBKTest.Open()
        cmdTest.ExecuteNonQuery()
        cnBKTest.Close()
    End Sub

    Protected Sub btnLogOff_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogOff.Click
        Response.Redirect("https://syep.wf1broward.com/Applicant_Verification_Login.aspx")
    End Sub
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
        'Test here to put in Page_Load
        'If Not Page.IsPostBack Then
        '    Dim saveButton As Button = CType(FormView1.FindControl("updatebutton"), Button)
        '    Dim verifiedCheckBox As CheckBox = CType(FormView1.FindControl("CheckBox1"), CheckBox)
        '    If verifiedCheckBox.Checked = False Then
        '        saveButton.Enabled = False
        '    Else
        '        saveButton.Enabled = True
        '    End If
        'End If

    End Sub


    Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView1.DataBound
        'If FormView1.CurrentMode = FormViewMode.ReadOnly Then
        '    Dim lbl As Label = FormView1.FindControl("Label1")
        '    Dim img As Image = FormView1.FindControl("Image1")
        '    Response.Write(lbl.Text)
        '    Response.Write(img.ImageUrl)
        'End If

        'If Not Page.IsPostBack Then
        '    MyDropDownList.DataTextField = "FieldOne"
        '    MyDropDownList.DataValueField = "FieldTwo"
        '    MyDropDownList.DataBind()
        '    MyDropDownList.Items.Insert(0, '-- Select One Item --')
        'End If


        If FormView1.CurrentMode = FormViewMode.ReadOnly Then
            Dim StatusLabel As Label = CType(FormView1.FindControl("Status"), Label)
            Dim StatusImage As Image = CType(FormView1.FindControl("Image1"), Image)
            Dim DOBLabel As Label = CType(FormView1.FindControl("DOBLabel"), Label)

            'Instead of changeing the label, use formatting in the Template.  Okay, it worked just fine now that it's inside the .ReadOnly:
            Dim SSNLabel As Label = CType(FormView1.FindControl("SSNLabel"), Label)
            SSNLabel.Text = SSNLabel.Text.Substring(0, 3) + "-" + SSNLabel.Text.Substring(3, 2) + "-" + SSNLabel.Text.Substring(5, 4)

            If StatusLabel.Text = "1" Then
                StatusImage.ImageUrl = "~/images/StatusGreen.png"
                StatusLabel.Text = "Paperwork Complete"
            ElseIf StatusLabel.Text = "2" Then
                StatusImage.ImageUrl = "~/images/StatusYellow.png"
                StatusLabel.Text = "Pending Bank Info"
            ElseIf StatusLabel.Text = "3" Then
                StatusImage.ImageUrl = "~/images/StatusRed.png"
                StatusLabel.Text = "Applicant Ineligible"
            Else
                StatusImage.ImageUrl = "~/images/StatusUnk1.png"
                StatusLabel.Text = "Paperwork Not Reviewed"
            End If

            'If CDate(DOBLabel.Text) < CDate("07/31/1984") Then
            '    DOBLabel.Text += "  - TOO OLD"
            '    DOBLabel.BackColor = Drawing.Color.Red
            '    DOBLabel.ForeColor = Drawing.Color.White
            '    DOBLabel.Font.Bold = ("True")
            '    'StatusImage.ImageUrl = "~/images/StatusRed.png"
            'ElseIf CDate(DOBLabel.Text) > CDate("06/08/1993") Then
            '    DOBLabel.Text += "  - TOO YOUNG"
            '    DOBLabel.BackColor = Drawing.Color.Red
            '    DOBLabel.ForeColor = Drawing.Color.White
            '    DOBLabel.Font.Bold = ("True")
            '    'StatusImage.ImageUrl = "~/images/StatusRed.png"
            'End If
            If CDate(DOBLabel.Text) < CDate("06/12/1992") Then
                DOBLabel.Text += "  - TOO OLD"
                DOBLabel.BackColor = Drawing.Color.Red
                DOBLabel.ForeColor = Drawing.Color.White
                DOBLabel.Font.Bold = ("True")
                ''StatusImage.ImageUrl = "~/images/StatusRed.png"
            ElseIf CDate(DOBLabel.Text) >= CDate("06/12/1992") And CDate(DOBLabel.Text) <= CDate("06/13/1993") Then
                DOBLabel.Text += "  - (18)"  'WIA?
                DOBLabel.BackColor = Drawing.Color.Blue
                DOBLabel.ForeColor = Drawing.Color.White
                DOBLabel.Font.Bold = ("True")
                'StatusImage.ImageUrl = "~/images/StatusRed.png"
            ElseIf CDate(DOBLabel.Text) > CDate("06/13/1993") And CDate(DOBLabel.Text) <= CDate("06/13/1995") Then
                DOBLabel.Text += "  - (16-17)" 'CSC?
                DOBLabel.BackColor = Drawing.Color.Orange
                DOBLabel.ForeColor = Drawing.Color.White
                DOBLabel.Font.Bold = ("True")
                'StatusImage.ImageUrl = "~/images/StatusRed.png"
            ElseIf CDate(DOBLabel.Text) > CDate("06/13/1995") Then
                DOBLabel.Text += "  - TOO YOUNG"
                DOBLabel.BackColor = Drawing.Color.Red
                DOBLabel.ForeColor = Drawing.Color.White
                DOBLabel.Font.Bold = ("True")
                'StatusImage.ImageUrl = "~/images/StatusRed.png"
            End If
        Else
            'If the FormView IS in Edit mode then set the value of the SSNTextBox to it's text so the dots display since the textbox is in TextMode="password" mode.
            Dim SSNTextBox As TextBox = CType(FormView1.FindControl("SSNTextBox"), TextBox)
            SSNTextBox.Attributes.Add("value", SSNTextBox.Text)
        End If

    End Sub
End Class

Open in new window


Here is my Select stored procedure.  
ALTER PROCEDURE dbo.spSelectApplicantForVerification

AS
SELECT keyApplicantID, [LastName] + ', ' + [FirstName] + ', -' + RIGHT (SSN, 4) AS NameAndSSN 
FROM Applicants 
-- WHERE (txtConsidered like '%Y%') 
ORDER BY LastName, FirstName
	/* SET NOCOUNT ON */
	RETURN

Open in new window



<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Applicant_Verification.aspx.vb" Inherits="Applicant_Verification" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Applicant Verification</title>
<!--link rel="stylesheet" type="text/css" href="css/StyleSheet.css" /-->

<!-- This is the finished modified page  -->
    
<style type="text/css" media="screen">    
/*
.tab {
position:absolute;
left:9em;
width:17em;
}    
.container {position: relative; width: 100%; }
.copy {position: absolute; left: 300px; top: 0px; margin-top:2em; width: 435px; }


*/
h1	  {color:#8c004c; text-align:center; margin-left:auto; margin-right:auto; margin-bottom: 0px; padding-bottom: 0px; vertical-align:bottom; font-size:x-large;}
h2	  {text-align:center;}

.tab 
{
	Position:relative;
	}

.left {float:left;}
.right {float:right;}
.center { text-align: center; }

img { border-style:none; }
td { height:auto;}
input { height:15px;}
input.submit { height:auto;}

.moveFormViewDown
{
	margin-top:10px;
	margin-left:30px;
	}
.moveImageLeft
{
	display:inline;
	vertical-align:middle;
}

	.underlined
	{
		text-decoration: underline;
	}

	.style3
	{
		/*width: 150px;*/
	}

	.hidden
	{
		display:none;
	}
	.moveButtonRight
	{
		margin-left:20px;
	}
	.style4
	{
		width: 155px;
	}
	.style5
	{
		color: #FF0000;
	}
	.DontShow
	{
		display:none;
		}
	.style6
	{
		text-decoration: underline;
	}
</style>

<style type="text/css" media="print">    
	.DontPrint
	{
		display:none;
		}
	.PrintMe
	{
		display:inline;
		}		
</style>

</head>
<body>
    <form id="form1" runat="server">

		<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

        <div class="DontPrint">
            <table border="0" style="margin-left:auto; margin-right:auto; width:100%;">
                <tr><td style="width:120px;">
						<%--<a href="http://www.wf1broward.com" ><img src="images/WF1_Logo009.gif" alt="WorkForce One Logo" class="left" width="237" height="80"/></a>--%>
						<a href="http://www.wf1broward.com" ><img src="images/WF1_Logo009.gif" alt="WorkForce One Logo" class="left" width="118" height="40"/></a>
					</td>
                    <td>
						<div class="DontPrint">
							<h1>Youth Information Verification</h1>
                        </div>
                    </td>
                    <td style="width:100px;">
						<%--<a href="http://www.cscbroward.org/"><img src="images/CSC_Logo10.gif" alt="Children's Services Council Logo" class="right" width="125" height="80" /></a>--%>&nbsp;
                    </td>
                </tr>
            </table>
        </div>
        <div class="DontShow PrintMe" style="margin-left:175px;">
			<h1>SYEP 2011&nbsp; -&nbsp; Applicant Summary</h1>
        </div>
    <hr />
	<%--<asp:ValidationSummary ID="ValidationSummary1" runat="server" />--%>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
	<ContentTemplate>

	<div style="float:right; position:relative; left:-1em;" class="DontPrint">
		<br />
		<asp:Button ID="btnLogOff" runat="server" Text="Log Off" Height="25px" />
		<br />
		<asp:Button ID="Button2" runat="server" Text="Admin Page" Height="25px"
					PostBackUrl="https://syep.wf1broward.com/admin.aspx?target=Employer" />
	</div>

<div style="float:left; clear:both; position:relative; left:10px;">
	<asp:Label ID="lblUserName" runat="server" Text="Not Logged In"></asp:Label>
</div>
<div style="float:left; clear:both; position:relative; left:10px;" class="DontPrint">
	<div>
	<br />
        <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
						  DataSourceID="ParameterFromStoredProcedure" 
						  DataTextField="NameAndSSN" 
						  DataValueField="keyApplicantID" Font-Names="Arial Narrow" Width="210px"
						  >
        </asp:DropDownList>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SYEP2007ConnectionString1 %>" 
			SelectCommand="spSelectApplicantForVerification" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="ParameterFromStoredProcedure" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SYEP2007ConnectionString1 %>" 
			SelectCommand="spSelectApplicantForVerification_CSC_WIA" SelectCommandType="StoredProcedure" 
			>
        	<SelectParameters>
				<asp:ControlParameter ControlID="radCSCWIA" Name="Program" PropertyName="SelectedValue" 
					Type="String" />
			</SelectParameters>
        </asp:SqlDataSource>
		<br />
		<asp:RadioButtonList ID="radCSCWIA" runat="server" 
					AutoPostBack="true" 
					RepeatDirection="Vertical" 
					RepeatLayout="Flow" CellPadding="2" CellSpacing="2"
					>
				<asp:ListItem Value="CSC">CSC &nbsp;</asp:ListItem>
				<asp:ListItem Value="WIA">WIA &nbsp;</asp:ListItem>
				<asp:ListItem Value="COF">COF &nbsp;</asp:ListItem>
				<asp:ListItem Value="PB">PB &nbsp;</asp:ListItem>
				<asp:ListItem Value="DB">DB &nbsp;</asp:ListItem>
				<asp:ListItem Value='%%'>XX &nbsp;</asp:ListItem>
				<asp:ListItem Value='%%'>XX &nbsp;</asp:ListItem>
				<asp:ListItem Value='%%' Selected="True">All</asp:ListItem>
		</asp:RadioButtonList>
</div>     
</div>
       
<%--<div class="container"> <!-- Container class allows copy class to position the FormView and lets the fields use absolute positioning-->--%>

<div style="margin-left:auto; margin-right:auto; text-align:center; width:600px;">
        <asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1" 
            BackColor="White" BorderColor="#E7E7FF" BorderStyle="Double" BorderWidth="1px" 
            CellPadding="3" GridLines="Both" 
            DataKeyNames="keyApplicantID"
            CssClass="moveFormViewDown">
            <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
            <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
            <EditItemTemplate>
            <table style="text-align:left; width:550px;">
<%--            <tr>
            <td>
                ApplicantID:
            </td>
            <td>
                <asp:Label ID="keyApplicantIDLabel1" runat="server" Text='<%# Eval("keyApplicantID") %>' CssClass="tab" />
			</td>
			</tr>--%>
			<tr>
			<td class="style4">
                Last, First, MI:
            </td>
            <td>
                <asp:TextBox ID="LastNameTextBox" runat="server" Text='<%# Bind("LastName") %>' CssClass="tab"/>
				,
                <asp:TextBox ID="FirstNameTextBox" runat="server" Text='<%# Bind("FirstName") %>' CssClass="tab" Width="125px" />
				,
                <asp:TextBox ID="MITextBox" runat="server" Text='<%# Bind("MI") %>' CssClass="tab" MaxLength="1" Width="15px" />
			</td>
			</tr>
<%--			<tr>
			<td>
                MI:
            </td>
            <td>
                <asp:TextBox ID="MITextBox" runat="server" Text='<%# Bind("MI") %>' CssClass="tab" MaxLength="1" Width="15px" />
			</td>
			</tr>--%>
			<tr>
			<td class="style4">
                DOB:
            </td>
            <td>    
                <asp:TextBox ID="DOBTextBox" runat="server" Text='<%# Bind("DOB", "{0:d}") %>' CssClass="" 
					CausesValidation="True" ToolTip="Just type over old values, don't delete first."  MaxLength="10" Width="100px" />
                <asp:RangeValidator ID="RangeValidator1" runat="server" 
                    ControlToValidate="DOBTextBox" ErrorMessage="Not Eligible" Font-Size="X-Small" 
                    MaximumValue="6/15/1994" MinimumValue="6/15/1990" Type="Date"
                    Enabled="False"> </asp:RangeValidator>
                <cc1:MaskedEditExtender id="maskDOBTextBox" targetcontrolid="DOBTextBox" runat="Server" mask="99/99/9999" masktype="Date"></cc1:MaskedEditExtender>
			</td>
			</tr>

			<tr>
			<td class="style4">
                SSN:
            </td>
            <td> 
                <asp:TextBox ID="SSNTextBox" runat="server" Text='<%# Bind("SSN") %>' CssClass="tab" MaxLength="9" Width="100px" 
					ToolTip="Don't change this field unless the correct SSN below doesn't match." TextMode="Password" />
				<%--<cc1:maskededitextender id="maskSSNTextBox" targetcontrolid="SSNTextBox" runat="server" mask="999-99-9999" 
					masktype="Number" AutoComplete="False"></cc1:maskededitextender>--%>
			</td>
			</tr>
			<tr>
			<td class="style4">
                Type SSN from Card:
            </td>
            <td>
                <asp:TextBox ID="VerifySSN" runat="server" Text="" CssClass="tab" MaxLength="9" Width="100px" 
					ToolTip="Numbers must match before you can save changes." />
				<%--<cc1:maskededitextender id="maskVerifySSN" targetcontrolid="VerifySSN" runat="server" mask="999-99-9999" 
					masktype="Number" AutoComplete="False"></cc1:maskededitextender>--%>
				<asp:CompareValidator ID="valVerifySSN" runat="server" ErrorMessage="CompareValidator" ControlToValidate="VerifySSN" ControlToCompare="SSNTextBox" Text="SSN's Don't Match!"></asp:CompareValidator>	
			</td>
			</tr>

			<tr>
			<td class="style4">
                Address:
            </td>
            <td>
                <asp:TextBox ID="StreetNameTextBox" runat="server" Text='<%# Bind("StreetName") %>' CssClass="tab" />
			</td>
			</tr>
			<tr>
			<td class="style4">
				City, State Zip:
            </td>
            <td>
                <asp:TextBox ID="CityNameTextBox" runat="server" Text='<%# Bind("CityName") %>' CssClass="tab" />
				,
                <asp:TextBox ID="StateTextBox" runat="server" Text='<%# Bind("txtState") %>' CssClass="tab" MaxLength="2" Width="30px" />&nbsp;&nbsp;
                <asp:TextBox ID="ZipCodeTextBox" runat="server" Text='<%# Bind("ZipCode") %>' CssClass="tab" MaxLength="5" Width="60px" />
			</td>
			</tr>
			<tr>
			<td class="style4">
                Telephone:
            </td>
            <td>
                <asp:TextBox ID="txtHomeTelephoneTextBox" runat="server" Text='<%# Bind("txtHomeTelephone") %>' 
					CssClass="tab" ToolTip="Just type over old values, don't delete first."  MaxLength="14" Width="125px"/>
			</td>
			</tr>
			<tr>
			<td class="style4">
                Cellphone:
            </td>
            <td>
                <asp:TextBox ID="txtCellphoneTextBox" runat="server" Text='<%# Bind("txtCellphone") %>' 
					CssClass="tab" ToolTip="Just type over old values, don't delete first."  MaxLength="14" Width="125px"/>
			</td>
			</tr>
			<tr>
			<td class="style4">
                Household Income:
            </td>
            <td>
                <asp:TextBox ID="HouseHoldIncomeID" runat="server" Text='<%# Bind("HouseHoldIncomeID") %>' CssClass="tab" MaxLength="1" Width="15px" />
			</td>
			</tr>
			<tr>
			<td class="style4">
                Considered:
            </td>
            <td>
                <%--<asp:TextBox ID="txtConsideredTextBox" runat="server" Text='<%# Bind("txtConsidered") %>' CssClass="tab" MaxLength="3" Width="30px"  ReadOnly="False" Enabled="True" />--%>
                <asp:Label ID="lblConsidered" runat="server" Text='<%# Eval("txtConsidered") %>' CssClass="tab" />
			</td>
			</tr>
			<tr>
			<td class="style4">
               I Verified Above Info:
            </td>
            <td>
                <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("Verify") %>' />
			</td>
			</tr>
<%--			<tr class="hidden">
			<td class="style4">
                Orientation Location:
            </td>
            <td>
                <asp:TextBox ID="OrientationLocation" runat="server" Text='<%# Bind("OrientationLocation") %>' 
					MaxLength="1" Width="15px" />
			</td>
			</tr>--%>
			<tr>
			<td class="style4">
                Paperwork Status:
            </td>
            <td>
				<asp:RadioButtonList ID="radStatus" runat="server" RepeatDirection="Vertical" 
								 RepeatLayout="Flow" 
								 SelectedValue='<%# Bind("Status") %>'
								 >
		  				<asp:ListItem Value="0">Not Reviewed</asp:ListItem>
						<asp:ListItem Value="2">Complete, Pending Bank Application</asp:ListItem>
						<asp:ListItem Value="1">Complete</asp:ListItem>
						<asp:ListItem Value="3">Ineligible</asp:ListItem>
  				</asp:RadioButtonList>
<%--
						<asp:RadioButtonList ID="radStatus" runat="server" RepeatDirection="Vertical"
                                                 RepeatLayout="Flow"
								 DataSourceID="SqlDataSource1"
								 DataTextField="Status"
								 DataValueField="keyApplicantID"
                                                 SelectedValue='<%# Bind("Status") %>'
								 AppendDataBoundItems="True" 
                                                 >
						<asp:ListItem Value="0">None</asp:ListItem>
						<asp:ListItem Value="1">Complete</asp:ListItem>
						<asp:ListItem Value="2">Pending</asp:ListItem>
						<asp:ListItem Value="3">Ineligible</asp:ListItem>
                    </asp:RadioButtonList>
--%>

			</td>
			</tr>
<%--START BANK INFO			--%>

			<tr>
			<td class="style4">
                Routing No.:
            </td>
            <td>
                <asp:TextBox ID="txtRoutingNumber" runat="server" Text='<%# Bind("RoutingNumber") %>' CssClass="tab" MaxLength="9" Width="125px" />
			</td>
			</tr>
			<tr>
			<td class="style4">
                Account No.:
            </td>
            <td>
                <asp:TextBox ID="txtBankAccount" runat="server" Text='<%# Bind("BankAccount") %>' CssClass="tab" MaxLength="25" Width="150px" />
			</td>
			</tr>
<%--
			<tr>
			<td class="style4">
                Account Type:
<br />
            </td>
            <td>
                <asp:RadioButtonList ID="radBankAccountType" runat="server" RepeatDirection="Horizontal" 
								 RepeatLayout="Flow" 
								 SelectedValue='<%# Bind("BankAccountType") %>'
								 >
		  				<asp:ListItem Value="C">Checking</asp:ListItem>
						<asp:ListItem Value="S">Savings</asp:ListItem>
		  				<asp:ListItem Value='0'>None</asp:ListItem>
  				</asp:RadioButtonList>
				<br />
			</td>
			</tr>
--%>
<%--
			<tr>
			<td class="style4">
                2nd Account#:
            </td>
            <td>
                <asp:TextBox ID="txtSecondAccount" runat="server" Text='<%# Bind("SecondAccount") %>' CssClass="tab" MaxLength="25" Width="150px" />
			</td>
			</tr>
			<tr>
			<td class="style4">
                2nd Type:
            </td>
            <td>
                <asp:RadioButtonList ID="radSecondAccountType" runat="server" RepeatDirection="Horizontal" 
								 RepeatLayout="Flow" 
								 SelectedValue='<%# Bind("SecondAccountType") %>'
								 >
		  				<asp:ListItem Value="C">Checking</asp:ListItem>
						<asp:ListItem Value="S">Savings</asp:ListItem>
		  				<asp:ListItem Value='0'>None</asp:ListItem>
  				</asp:RadioButtonList>
			</td>
			</tr>
--%>
<%--END BANK INFO			--%>	
<%--START Other optional Information--%>
<%--		
			<tr>
			<td class="style4">
                		Youth Readiness Training:
            		</td>
            		<td>
				<asp:RadioButtonList ID="radYouthReadinessTraining" runat="server" RepeatDirection="Horizontal" 
								 RepeatLayout="Flow" 
								 SelectedValue='<%# Bind("YouthReadinessTraining") %>'
								 >
		  				<asp:ListItem Value="">Pending</asp:ListItem>
						<asp:ListItem Value="Scheduled">Scheduled</asp:ListItem>
		  				<asp:ListItem Value='Complete'>Complete</asp:ListItem>
  				</asp:RadioButtonList>
			</td>
			</tr>
			<tr>
			<td class="style4">
                		TabeTaken:
            		</td>
            		<td>
				<asp:RadioButtonList ID="radTabeTaken" runat="server" RepeatDirection="Horizontal" 
								 RepeatLayout="Flow" 
								 SelectedValue='<%# Bind("TabeTaken") %>'
								 >
		  				<asp:ListItem Value="Yes">Yes</asp:ListItem>
						<asp:ListItem Value="No">No</asp:ListItem>
  				</asp:RadioButtonList>
			</td>
			</tr>

			<tr>
			<td class="style4">
                		Goals:
            		</td>
            		<td>
				<asp:RadioButtonList ID="radGoals" runat="server" RepeatDirection="Horizontal" 
								 RepeatLayout="Flow" 
								 SelectedValue='<%# Bind("Goals") %>'
								 >
		  				<asp:ListItem Value="Yes">Yes</asp:ListItem>
						<asp:ListItem Value="No">No</asp:ListItem>
  				</asp:RadioButtonList>
			</td>
			</tr>
			<tr>
			<td class="style4">
                		Eval1:
            		</td>
            		<td>
				<asp:RadioButtonList ID="radPerformanceEval1" runat="server" RepeatDirection="Horizontal" 
								 RepeatLayout="Flow" 
								 SelectedValue='<%# Bind("PerformanceEval1") %>'
								 >
		  				<asp:ListItem Value="Yes">Yes</asp:ListItem>
						<asp:ListItem Value="No">No</asp:ListItem>
  				</asp:RadioButtonList>
			</td>
			</tr>
			<tr>
			<td class="style4">
                		Eval2:
            		</td>
            		<td>
				<asp:RadioButtonList ID="radPerformanceEval2" runat="server" RepeatDirection="Horizontal" 
								 RepeatLayout="Flow" 
								 SelectedValue='<%# Bind("PerformanceEval2") %>'
								 >
		  				<asp:ListItem Value="Yes">Yes</asp:ListItem>
						<asp:ListItem Value="No">No</asp:ListItem>
  				</asp:RadioButtonList>
			</td>
			</tr>
			<tr>
			<td class="style4">
                		Disclosure:
            		</td>
            		<td>
				<asp:RadioButtonList ID="radDisclosure" runat="server" RepeatDirection="Horizontal" 
								 RepeatLayout="Flow" 
								 SelectedValue='<%# Bind("Disclosure") %>'
								 >
		  				<asp:ListItem Value="Yes">Yes</asp:ListItem>
						<asp:ListItem Value="No">No</asp:ListItem>
  				</asp:RadioButtonList>
			</td>
			</tr>
			<tr>
			<td class="style4">
                		Training Outlines:
            		</td>
            		<td>
				<asp:RadioButtonList ID="radTrainingOutlines" runat="server" RepeatDirection="Horizontal" 
								 RepeatLayout="Flow" 
								 SelectedValue='<%# Bind("TrainingOutlines") %>'
								 >
		  				<asp:ListItem Value="Yes">Yes</asp:ListItem>
						<asp:ListItem Value="No">No</asp:ListItem>
  				</asp:RadioButtonList>
			</td>
			</tr>
			
--%>
<%--END Other optional Information--%>

		<%--	<tr>
				<td class="style4">
		        </td>
				<td>
				</td>
			</tr>
				<tr>
					<td class="style4">
						&nbsp;</td>
					<td>
						&nbsp;</td>
				</tr>
				<tr>
					<td class="style4">
						&nbsp;</td>
					<td>
						&nbsp;</td>
				</tr>
				<tr>
					<td class="style4">
						&nbsp;</td>
					<td>
						&nbsp;</td>
				</tr>--%>
			<tr>
			<td class="style4">
                W4 Exemptions:
            </td>
            <td>
                <asp:TextBox ID="txtW4" runat="server" Text='<%# Bind("W4") %>' CssClass="tab" MaxLength="2" Width="15px" />
			</td>
			</tr>
			<tr>
			<td class="style4">
                Orientation Location:
            </td>
            <td>
                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("OrientationLocation") %>' CssClass="tab" MaxLength="30" Width="150px" />
			</td>
			</tr>
			<tr>
			<td class="style4" colspan="2">
                Notes&nbsp;(Required&nbsp;when&nbsp;changing&nbsp;youth's&nbsp;Activity):
                <asp:TextBox ID="txtVerifyComments" runat="server" Text='<%# Bind("VerifyComments") %>' Width="485px" 
					Wrap="true" TextMode="MultiLine" Rows="3" />
			</td>
			</tr>
			<tr>
			<td class="style4">
                Change Activity:
            </td>
            <td>
				<asp:RadioButtonList ID="radChangeActivity" runat="server" RepeatDirection="Horizontal" 
								 RepeatLayout="Flow" 
								 SelectedValue='<%# Bind("ddlActivityType") %>'
								 >
						<asp:ListItem Value="WIA">WIA</asp:ListItem>
						<asp:ListItem Value="CSC">CSC</asp:ListItem>
						<asp:ListItem Value="COF">COF</asp:ListItem>
						<asp:ListItem Value="PB">PB</asp:ListItem>
						<asp:ListItem Value="DB">DB</asp:ListItem>
						<asp:ListItem Value="CSpr">CSpr</asp:ListItem>
  				</asp:RadioButtonList>
			</td>
			</tr>
			
			</table>
                <br />
                <div>
                <asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Save" 
						CssClass="submit" onclick="UpdateButton_Click" />&nbsp;
                <asp:Button ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" CssClass="submit" />
                </div>
            </EditItemTemplate>
            <InsertItemTemplate>
                LastName:
                <asp:TextBox ID="LastNameTextBox" runat="server" Text='<%# Bind("LastName") %>' />
                <br />
                FirstName:
                <asp:TextBox ID="FirstNameTextBox" runat="server" Text='<%# Bind("FirstName") %>' />
                <br />
                MI:
                <asp:TextBox ID="MITextBox" runat="server" Text='<%# Bind("MI") %>' />
                <br />
                DOB:
                <asp:TextBox ID="DOBTextBox" runat="server" Text='<%# Bind("DOB") %>' />
                <br />
                SSN:
                <asp:TextBox ID="SSNTextBox" runat="server" Text='<%# Bind("SSN") %>' />
                <br />
                StreetName:
                <asp:TextBox ID="StreetNameTextBox" runat="server" Text='<%# Bind("StreetName") %>' />
                <br />
                CityID:
                <asp:TextBox ID="CityIDTextBox" runat="server" Text='<%# Bind("CityID") %>' />
                <br />
                ZipID:
                <asp:TextBox ID="ZipIDTextBox" runat="server" Text='<%# Bind("ZipID") %>' />
                <br />
                CityName:
                <asp:TextBox ID="CityNameTextBox" runat="server" Text='<%# Bind("CityName") %>' />
                <br />
                State:
                <asp:TextBox ID="StateTextBox" runat="server" Width="4em" Text='<%# Bind("txtState") %>'/>
                <br />
                ZipCode:
                <asp:TextBox ID="ZipCodeTextBox" runat="server" Width="4em" Text='<%# Bind("ZipCode") %>'/>
                <br />
                txtHomeTelephone:
                <asp:TextBox ID="txtHomeTelephoneTextBox" runat="server" Text='<%# Bind("txtHomeTelephone") %>' />
                <br />
                txtCellphone:
                <asp:TextBox ID="txtCellphoneTextBox" runat="server" Text='<%# Bind("txtCellphone") %>' />
                <br />
                Considered:
                <asp:TextBox ID="txtConsideredTextBox" runat="server" Width="2em" Text='<%# Bind("txtConsidered") %>' />
                <br />
                Verify:
                <asp:TextBox ID="VerifyTextBox" runat="server" Width="3em" Text='<%# Bind("Verify") %>' />
                <br />
                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" /> &nbsp;
                <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </InsertItemTemplate>
            <ItemTemplate>
            <table style="text-align:left; width:550px;">
<%--            <tr>
            <td>
                ApplicantID:
			</td>
			<td>
                <asp:Label ID="keyApplicantIDLabel1" runat="server" Text='<%# Eval("keyApplicantID") %>' CssClass="tab" />
			</td>
			</tr>--%>
			<tr>
			<td class="style4">
                Last, First, MI:
			</td>
			<td>
                <asp:Label ID="LastNameLabel" runat="server" Text='<%# Eval("LastName") %>' CssClass="tab" />
				,
				<asp:Label ID="FirstNameLabel" runat="server" CssClass="tab" Text='<%# Eval("FirstName") %>' />
				,
				<asp:Label ID="Label1" runat="server" CssClass="tab" Text='<%# Eval("MI") %>' />
			</td>
			</tr>
<%--			<tr>
			<td>
                MI:
			</td>
			<td>
                <asp:Label ID="MILabel" runat="server" Text='<%# Eval("MI") %>' CssClass="tab" />
			</td>
			</tr>--%>
			<tr>
			<td class="style4">
                DOB:
			</td>
			<td>
                <asp:Label ID="DOBLabel" runat="server" Text='<%# Eval("DOB", "{0:d}") %>' CssClass="tab" />
			</td>
			</tr>
			<tr>
			<td class="style4">
                SSN:
			</td>
			<td>
                <%--<asp:Label ID="SSNLabel" runat="server" Text='<%# Eval("SSN", "{0:###-##-####}") %>' CssClass="tab" />--%><asp:Label ID="SSNLabel" runat="server" Text='<%# Eval("SSN") %>' CssClass="tab" />
			</td>
			</tr>
			<tr>
			<td class="style4">
                Address:
			</td>
			<td>
                <asp:Label ID="StreetNameLabel" runat="server" Text='<%# Eval("StreetName") %>' CssClass="tab" />
			</td>
			</tr>
			<tr>
			<td class="style4">

<%--                CityID:
                <asp:Label ID="CityIDLabel" runat="server" Text='<%# Bind("CityID") %>' CssClass="tab" />
                <br />
                ZipID:
                <asp:Label ID="ZipIDLabel" runat="server" Text='<%# Bind("ZipID") %>' CssClass="tab" />
                <br />
--%>City, State Zip:
			</td>
			<td>
                <asp:Label ID="CityNameLabel" runat="server" Text='<%# Eval("CityName") %>' CssClass="tab" />
				,
				<asp:Label ID="StateLabel" runat="server" CssClass="tab" Text='<%# Eval("txtState") %>' /> &nbsp;&nbsp;
				<asp:Label ID="ZipCodeLabel" runat="server" CssClass="tab" Text='<%# Eval("ZipCode") %>' />
			</td>
			</tr>
			<tr>
			<td class="style4">
                Telephone:
			</td>
			<td>
                <asp:Label ID="txtHomeTelephoneLabel" runat="server" Text='<%# Eval("txtHomeTelephone") %>' CssClass="tab" />
			</td>
			</tr>
			<tr>
			<td class="style4">
                Cellphone:
			</td>
			<td>
                <asp:Label ID="txtCellphoneLabel" runat="server" Text='<%# Eval("txtCellphone") %>' CssClass="tab" />
			</td>
			</tr>
			<tr>
			<td class="style4">
                Income / Persons:
			</td>
			<td>
                <asp:Label ID="HouseHoldIncomeID" runat="server" Text='<%# Eval("HouseHoldIncomeID") %>' CssClass="tab" /> / 
                <asp:Label ID="NumberInHouseholdLabel" runat="server" Text='<%# Eval("NumberInHousehold") %>' CssClass="tab" />
			</td>
			</tr>
			<tr>
			<td class="style4">
                Considered:
			</td>
			<td>
                <asp:Label ID="txtConsideredLabel" runat="server" Text='<%# Eval("txtConsidered") %>' CssClass="tab" />
			</td>
			</tr>
			<tr>
			<td class="style4">
				Verified:
			</td>
			<td>
				<asp:Label ID="VerifyLabel" runat="server" CssClass="tab" Text='<%# Eval("Verify") %>' />
			</td>
			</tr>
			<tr>
			<td class="style4">
				Date Updated:
			</td>
			<td>
				<asp:Label ID="Label2" runat="server" CssClass="tab" Text='<%# Eval("DateUpdated") %>' />
			</td>
			</tr>
			<tr>
			<td class="style4">
				Updated By:
			</td>
			<td>
				<asp:Label ID="Label3" runat="server" CssClass="tab" Text='<%# Eval("LastUpdatedBy") %>' />
			</td>
			</tr>
<%--			<tr>
			<td class="style3">
                Location:
			</td>
			<td>
                <asp:Label ID="OrientationLocation" runat="server" Text='<%# Eval("OrientationLocation") %>' CssClass="tab" />
			</td>
			</tr>--%>
				<tr>
					<td class="style4">
						Status:
					</td>
					<td>
						<%--<asp:Label ID="Status" runat="server" Text='<%# Bind("Status") %>' CssClass="tab" />--%>
						<%--<asp:Image ID="Image1" runat="server" ImageUrl="~/images/arrow007.gif" />--%>
						<asp:Image ID="Image1" runat="server" ImageUrl="~/images/StatusUnk1.png" CssClass="moveImageLeft" Visible="True" />
						<asp:Label ID="Status" runat="server" Visible="true" Text='<%# Eval("Status") %>'></asp:Label>
					</td>
				</tr>
<%--START Bank Info				--%>

			<tr>
			<td class="style4">
                Routing No.:
			</td>
			<td>
                <asp:Label ID="lblRoutingNumber" runat="server" Text='<%# Eval("RoutingNumber") %>' CssClass="tab" />
			</td>
			</tr>
			<tr>
			<td class="style4">
                Account No.:
			</td>
			<td>
                <asp:Label ID="lblBankAccount" runat="server" Text='<%# Eval("BankAccount") %>' CssClass="tab" />
			</td>
			</tr>
<%--
			<tr>
			<td class="style4">
                Account Type:
<br /><br />
			</td>
			<td>
                <asp:Label ID="lblBankAccountType" runat="server" Text='<%# Eval("BankAccountType") %>' CssClass="tab" />
			</td>
			</tr>
--%>
<%--
			<tr>
			<td class="style3">
                2nd Account#:
			</td>
			<td>
                <asp:Label ID="lblSecondAccount" runat="server" Text='<%# Eval("SecondAccount") %>' CssClass="tab" />
			</td>
			</tr>
			<tr>
			<td class="style3">
                2nd Type:
			</td>
			<td>
                <asp:Label ID="lblSecondAccountType" runat="server" Text='<%# Eval("SecondAccountType") %>' CssClass="tab" />
			</td>
			</tr>
--%>			
<%--END Bank Info				--%>
<%--START Other optional Information--%>
<%--
			<tr>
			<td class="style3">
                		Youth Readiness Training:
			</td>
			<td>
                		<asp:Label ID="lblYouthReadinessTraining" runat="server" Text='<%# Eval("YouthReadinessTraining") %>' CssClass="tab" />
			</td>
			</tr>
			<tr>
			<td class="style3">
                		Tabe Taken:
			</td>
			<td>
                		<asp:Label ID="lblTabeTaken" runat="server" Text='<%# Eval("TabeTaken") %>' CssClass="tab" />
			</td>
			</tr>

			<tr>
			<td class="style3">
                		Goals:
			</td>
			<td>
                		<asp:Label ID="lblGoals" runat="server" Text='<%# Eval("Goals") %>' CssClass="tab" />
			</td>
			</tr>

			<tr>
			<td class="style3">
                		Eval1:
			</td>
			<td>
                		<asp:Label ID="lblPerformanceEval1" runat="server" Text='<%# Eval("PerformanceEval1") %>' CssClass="tab" />
			</td>
			</tr>

			<tr>
			<td class="style3">
                		Eval2:
			</td>
			<td>
                		<asp:Label ID="lblPerformanceEval2" runat="server" Text='<%# Eval("PerformanceEval2") %>' CssClass="tab" />
			</td>
			</tr>

			<tr>
			<td class="style3">
                		Disclosure:
			</td>
			<td>
                		<asp:Label ID="lblDisclosure" runat="server" Text='<%# Eval("Disclosure") %>' CssClass="tab" />
			</td>
			</tr>
			<tr>
			<td class="style3">
                		Training Outlines:
			</td>
			<td>
                		<asp:Label ID="Label2" runat="server" Text='<%# Eval("TrainingOutlines") %>' CssClass="tab" />
			</td>
			</tr>
--%>			
<%--END Other optional Information--%>

			<tr>
			<td class="style4">
                W4 Exemptions:
			</td>
			<td>
                <asp:Label ID="lblW4" runat="server" Text='<%# Eval("W4") %>' CssClass="tab" />
			</td>
			</tr>
			<tr>
			<td class="style4">
                Orientation Location:
			</td>
			<td>
                <asp:Label ID="lblOrientationLocation" runat="server" Text='<%# Eval("OrientationLocation") %>' CssClass="tab" />
			</td>
			</tr>
			<tr>
			<td class="style3" colspan="2" bgcolor="#CCFFFF">
                Notes:
                <br />
                <asp:Label ID="lblVerifyComments" runat="server" Text='<%# Eval("VerifyComments") %>' 
					CssClass="tab" Width="480px" />
			</td>
			</tr>

			<tr>
			<td class="style3">
                		Work City Preference:
			</td>
			<td>
                		<asp:Label ID="lblWorkCityPreference" runat="server" Text='<%# Eval("WorksiteCityPreference") %>' CssClass="tab" />
			</td>
			</tr>


			<tr>
			<td class="style3">
                		Referred By:
			</td>
			<td>
                		<asp:Label ID="lblReferredBy" runat="server" Text='<%# Eval("txtOrgReferredBy") %>' CssClass="tab" />
			</td>
			</tr>

			<tr>
			<td class="style3">
                		Foster Child:
			</td>
			<td>
                		<asp:Label ID="FosterChildLabel" runat="server" Text='<%# Eval("cbFosterChild") %>' CssClass="tab" />
			</td>
			</tr>

			<tr>
			<td class="style3">
                		Pregnant:
			</td>
			<td>
                		<asp:Label ID="PregnantLabel" runat="server" Text='<%# Eval("cbPregnant") %>' CssClass="tab" />
			</td>
			</tr>

			<tr>
			<td class="style3">
                		Homeless:
			</td>
			<td>
                		<asp:Label ID="HomelessLabel" runat="server" Text='<%# Eval("cbHomeless") %>' CssClass="tab" />
			</td>
			</tr>

			<tr>
			<td class="style3">
                		Special Skills:
			</td>
			<td>
                		<asp:Label ID="SpecialSkillsLabel" runat="server" Text='<%# Eval("IdentifyingCharacteristic") %>' CssClass="tab" />
			</td>
			</tr>

			<tr>
			<td class="style3">
                		Name of Offence:
			</td>
			<td>
                		<asp:Label ID="Label4" runat="server" Text='<%# Eval("NameOfOffense") %>' CssClass="tab" />
			</td>
			</tr>

			<tr>
			<td class="style3">
                		Employer:
			</td>
			<td>
                		<asp:Label ID="Label5" runat="server" Text='<%# Eval("EmployerName") %>' CssClass="tab" />
			</td>
			</tr>

			<tr>
			<td class="style3">
                		Worksite:
			</td>
			<td>
                		<asp:Label ID="Label6" runat="server" Text='<%# Eval("WorksiteName") %>' CssClass="tab" />
			</td>
			</tr>

			<tr>
			<td class="style3">
                		Worksite Address:
			</td>
			<td>
                		<asp:Label ID="Label7" runat="server" Text='<%# Eval("txtWorksiteAddress") %>' CssClass="tab" />
			</td>
			</tr>

			<tr>
			<td class="style3">
                		Worksite City, Zip:
			</td>
			<td>
                		<asp:Label ID="Label8" runat="server" Text='<%# Eval("txtWorksiteCity") %>' CssClass="tab" />, &nbsp;
                		<asp:Label ID="Label9" runat="server" Text='<%# Eval("txtWorksiteZip") %>' CssClass="tab" />
			</td>
			</tr>

			<tr>
			<td class="style3">
                		Worksite Supervisor:
			</td>
			<td>
                		<asp:Label ID="Label13" runat="server" Text='<%# Eval("txtWorksiteSupervisor") %>' CssClass="tab" /> &nbsp; - &nbsp;
                		<asp:Label ID="Label14" runat="server" Text='<%# Eval("txtWorksiteSupTelephone") %>' CssClass="tab" />
			</td>
			</tr>


			<tr>
			<td class="style3">
                		Worksite Monitor:
			</td>
			<td>
                		<asp:Label ID="Label11" runat="server" Text='<%# Eval("MonitorFirstName") %>' CssClass="tab" />&nbsp;
                		<asp:Label ID="Label10" runat="server" Text='<%# Eval("MonitorLastName") %>' CssClass="tab" /> &nbsp; - &nbsp;
                		<asp:Label ID="Label12" runat="server" Text='<%# Eval("SYEPCellPhone") %>' CssClass="tab" />
			</td>
			</tr>
<%--
			<tr>
			<td class="style3">
                		Monitor Cellphone:
			</td>
			<td>
                		<asp:Label ID="Label12" runat="server" Text='<%# Eval("SYEPCellPhone") %>' CssClass="tab" />&nbsp;
			</td>
			</tr>
--%>



				
			</table>                
<br />
                <div>
                <asp:Button ID="editbutton" runat="server" CausesValidation="True" CommandName="Edit" Text="Edit" CssClass="submit" />&nbsp;&nbsp;
                <asp:Button ID="btnPrint" runat="server" Text="Print" onclientclick="printme()" CausesValidation="False" CssClass="submit" />
                <%--<asp:Button ID="InsertButton" runat="server" CausesValidation="true" CommandName="New" Text="New" />--%>
                </div>
            </ItemTemplate>
            <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
            <FooterTemplate>
                <div>
                WorkForce One
                </div>
            </FooterTemplate>
            <HeaderStyle BackColor="#006D75" Font-Bold="True" ForeColor="#F7F7F7" />
            <HeaderTemplate>
                <div>
                    Applicant ID#:  <asp:Label ID="keyApplicantIDLabel2" runat="server" Text='<%# Eval("keyApplicantID") %>' CssClass="tab" />
                </div>
            </HeaderTemplate>
            <EditRowStyle BackColor="#8C004C" Font-Bold="True" ForeColor="#F7F7F7" />
        </asp:FormView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SYEP2007ConnectionString1 %>" 
            DeleteCommand="DELETE FROM Applicants WHERE (keyApplicantID = @original_keyApplicantID) " 
            InsertCommand="INSERT INTO Applicants(LastName, FirstName, MI, SSN, StreetName, CityID, ZipID, DOB, txtHomeTelephone, txtCellphone, CityName, ZipCode, txtState, Verify, VerifyComments, txtConsidered, ddlActivityType, HouseholdIncomeID, Verified, Pending, Ineligible, Status, YouthReadinessTraining, TabeTaken, Goals, PerformanceEval1, PerformanceEval2, Disclosure, TrainingOutlines, TrainingOutlinesComment, ISS, ISSComment) VALUES (@LastName, @FirstName, @MI, @SSN, @StreetName, @CityID, @ZipID, @DOB, @txtHomeTelephone, @txtCellphone, @CityName, @ZipCode, @txtState, @Verify, @VerifyComments, @txtConsidered, @ddlActivityType, @HouseholdIncomeID, @Verified, @Pending, @Ineligible, @Status, @YouthReadinessTraining, @TabeTaken, @Goals, @PerformanceEval1, @PerformanceEval2, @Disclosure, @TrainingOutlines, @TrainingOutlinesComment, @ISS, @ISSComment)" 
            SelectCommand="spSelectApplicantVerificationForm"
            SelectCommandType="StoredProcedure"
			UpdateCommand="spUpdateApplicantVerificationForm" 
			UpdateCommandType="StoredProcedure">
            <SelectParameters>
                <asp:ControlParameter ControlID="DropDownList1" Name="keyApplicantID" PropertyName="SelectedValue" Type="Int32" DefaultValue="" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="original_keyApplicantID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="keyApplicantID" />
                <asp:Parameter Name="LastName" Type="String" />
                <asp:Parameter Name="FirstName" Type="String" />
                <asp:Parameter Name="MI" Type="String" />
                <asp:Parameter Name="SSN" Type="String" />
                <asp:Parameter Name="StreetName" Type="String" />
                <asp:Parameter Name="DOB" Type="DateTime" />
                <asp:Parameter Name="txtHomeTelephone" Type="String" />
                <asp:Parameter Name="txtCellphone" Type="String" />
                <asp:Parameter Name="CityName" Type="String" />
                <asp:Parameter Name="ZipCode" Type="Int32" />
                <asp:Parameter Name="txtState" Type="String" />
                <asp:Parameter Name="Verify" Type="String" />
                <asp:Parameter Name="VerifyComments" Type="String" />
                <asp:Parameter Name="ddlActivityType" Type="String" />
                <asp:Parameter Name="HouseholdIncomeID" Type="Int32" />
                <asp:Parameter Name="Status" Type="String" />
                <asp:Parameter Name="RoutingNumber" Type="String" />
                <asp:Parameter Name="BankAccount" Type="String" />
                <asp:Parameter Name="BankAccountType" Type="String" />
                <asp:Parameter Name="W4" Type="String" />
                <asp:Parameter Name="OrientationLocation" Type="String" />
           </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="LastName" Type="String" />
                <asp:Parameter Name="FirstName" Type="String" />
                <asp:Parameter Name="MI" Type="String" />
                <asp:Parameter Name="SSN" Type="String" />
                <asp:Parameter Name="StreetName" Type="String" />
                <asp:Parameter Name="CityID" Type="Int32" />
                <asp:Parameter Name="ZipID" Type="Int32" />
                <asp:Parameter Name="DOB" Type="DateTime" />
                <asp:Parameter Name="txtHomeTelephone" Type="String" />
                <asp:Parameter Name="txtCellphone" Type="String" />
                <asp:Parameter Name="CityName" Type="String" />
                <asp:Parameter Name="ZipCode" Type="Int32" />
                <asp:Parameter Name="txtState" Type="String" />
                <asp:Parameter Name="Verify" Type="String" />
                <asp:Parameter Name="VerifyComments" />
                <asp:Parameter Name="txtConsidered" Type="String" />
                <asp:Parameter Name="ddlActivityType" />
            	<asp:Parameter Name="HouseholdIncomeID" Type="Int32" />
            	<asp:Parameter Name="Verified" Type="String" />
				<asp:Parameter Name="Pending" Type="String" />
				<asp:Parameter Name="Ineligible" Type="String" />
            	<asp:Parameter Name="Status" Type="String" />
                <asp:Parameter Name="YouthReadinessTraining" Type="String" />
                <asp:Parameter Name="TabeTaken" Type="String" />
            	<asp:Parameter Name="Goals" />
				<asp:Parameter Name="PerformanceEval1" />
				<asp:Parameter Name="PerformanceEval2" />
				<asp:Parameter Name="Disclosure" />
            	<asp:Parameter Name="TrainingOutlines" />
				<asp:Parameter Name="TrainingOutlinesComment" />
				<asp:Parameter Name="ISS" />
				<asp:Parameter Name="ISSComment" />
            </InsertParameters>
        </asp:SqlDataSource>
</div>        

	</ContentTemplate>
</asp:UpdatePanel>
<br />
		<div style="text-align:left; border-style:double; border-color:Aqua; padding: 10px; width:65%; margin-left:auto; margin-right:auto;" class="DontPrint">
			<%--Date of Birth must be between 06/15/88 and 06/15/91 for WIA.<br />--%>
			Date of Birth must be between 06/12/92 and 06/13/95 for CSC.<br />
			<br />
			<span class="style5">&dagger; Ensure that you enter information correctly before marking a record &ldquo;Verified&rdquo;. &dagger; An 
			accuracy report, <span class="style6">by User Name</span>, is submitted to management.</span><br />
			<br />
			If Name, DOB, SSN, Address, Phone and Income are verified correct, then check the &ldquo;Info Verified&rdquo; check box.
			<br /><br />
			
			If they have brought all their paperwork in and it&#39;s all correct and complete then select &ldquo;Complete&rdquo;.<br />
			<%--If they have been determined to be Ineligable, then select "Ineligable".--%>
			<%--If "Editing Record: " does not show the record number or the record display is disabled, re-select a record.--%>
        </div>
		<%--
                CityID:
                <asp:TextBox ID="CityIDTextBox" runat="server" Text='<%# Bind("CityID") %>' CssClass="tab" ReadOnly="True" />
                <br />
                ZipID:
                <asp:TextBox ID="ZipIDTextBox" runat="server" Text='<%# Bind("ZipID") %>' CssClass="tab" ReadOnly="True" />
                <br />
--%>        
<script type="text/javascript">
	function printme() {
		window.print();
	}
    </script>
     
    </form>
</body>
</html>

Open in new window

0
Comment
Question by:megnin
  • 3
  • 2
5 Comments
 
LVL 35

Expert Comment

by:David Todd
Comment Utility
Hi,

Your timeframe does sound a little too long.

Your procedure returning all records without a where clause, will be okay at a few records (and I guess that 5000 fits in that category) but should that grow then you could have problems.

I suggest that you place an expiry column or a deleted flag - anything to start filtering your table, which will protect things in the off-chance your table grows.

Possibly you are trying to do a little too much wiht the display. Which leads to the question as to which bit is slow - the database, or the web serving. I suggest in this instance that it is the webserving that is slowing things down, unless something is badly wrong with the SQL Server.

What version of SQL? Do you have autoclose on - it should be OFF!

HTH
  David
0
 
LVL 1

Author Comment

by:megnin
Comment Utility
Hi David,

Thanks for the info.  I'm using SQL Server 2005 right now but that's going to be upgraded this weekend to 2008 R2.  I'll check the autoclose thing.

You have a good point about the webserving being what may be slowing things down.  We used to have our web and SQL servers in this local building and everything was snappy fast.  Then we moved our servers to a "colocation" offsite and everything has been slow since.

When I do filter the records, the smaller set comes up much faster than when I return all records.  The 5000 record table won't be growing, but I do need to return all the records in the place I'm doing that.  I'll try to find places I can return a filtered subset of the records when I can since that does make a difference.  

Once we select about 800 of the 5000 applicants I'll be able to filter down to the 800.

I've got a Windows Forms application we use for the selection process and that is slow as well.  It also used to be fast when the server was housed locally.  It also returns all 5000 records from the Applicants table and all several hundred records from a Worksites table Joined with a Job Position table.  It is used to copy the key ID number of the job position and employer (another table) into the Applicant's record to assign him to that job position.  It has a GridView for the Applicants and a GridView for the Worksite/Job Position.
0
 
LVL 35

Accepted Solution

by:
David Todd earned 500 total points
Comment Utility
Hi,

Okay, so what is happening is too many round trips.

Are both servers together in the co-location? Then too much of your filtering is done server-side, and not enough client-side. That is, when you touch a button on the form the page goes back to the server to figure out what to do.

Watch how much data is on the webform as those 5000 records are being transmitted on each page refresh - and possibly transmitted BOTH ways.

HTH
  David
0
 
LVL 1

Author Comment

by:megnin
Comment Utility
Yeah, I think you're right.  I'm still quite the beginner, so I'm doing a lot of things the first way I learned how.  I've just learned to do some clientside things like hiding and showing TextBoxes based on a RadioButtonList selection.  I was doing that server side for the longest.  I still haven't converted some old server side code to JavaScript for things like that.

Yeah, both servers are at the co-location.  I've got the RadioButtonLists to do one filter (server side) then the DropDownList (populated with three fields from all records) to select a person, then the GridView is retrieving all the records (at times) based on the parameter provided by the DropDownList.  I may be making up to six round trips to the database to select one person's record.  8-O (astonished face).

Is it possible to do any of that clientside?  I know JavaScript can't do any data access.  I haven't delved into Linq to SQL or anything more advanced than ADO.Net so far.
0
 
LVL 1

Author Closing Comment

by:megnin
Comment Utility
Thanks for the suggestions.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now