Solved

SQL IF ELSE Query not working in Gridview

Posted on 2009-06-29
13
691 Views
Last Modified: 2012-08-13
Greetings,  I have an IF ELSE SQL query to display in a Gridview.  Basically, there is a textbox that would pull a specific query to the Gridview.  this works fine.  In the event that the box is null, the query would pull into the gridview all rows with incident type "Deployer" and not in "Complete" status.  When I test the query in the Desgner (VB 2008), it runs correctly, no issue.  When I post the Web App, the Gridview is blank, unless you enter search criteria.  Makes no sense to me, and makes me wonder why the Designer has a query test tool when the test works but not the app.  Anyway, attached is my code.  Any help is greatly appreciated...I must also state that I'm not a developer and very new to SQL and ASP, so please forgive if my question is silly...Regards
Imports System.Data.SqlClient
Imports System.Net
Imports System.Xml.Serialization
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Deployer.aspx.vb" Inherits="Test" %>
 
<!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 runat="server">
    <title>Klingon Deployer</title>
    <style type="text/css">
 
 
        .style6
        {
            font-size: small;
            width: -300;
        }
        #LEOSTREAM
        {
            z-index: 1;
            left: 11px;
            top: 2359px;
            position: absolute;
        }
        #I1
        {
            position: relative;
        }
        .style8
        {
            width: 981px;
            height: 25px;
        }
        .style9
        {
            width: 991px;
            height: 25px;
        }
        .style12
        {
            height: 25px;
            width: 176px;
        }
        .style15
        {
            width: 154px;
            height: 25px;
        }
        .style19
        {
            font-size: large;
            font-weight: bold;
        }
        .style18
        {
            width: 155px;
        }
        #I2
        {
            position: relative;
        }
        .style22
        {
            width: 267px;
        }
        .style23
        {
            width: 188px;
        }
        .style24
        {
            width: 188px;
            font-weight: bold;
        }
        .style25
        {
            height: 25px;
            width: 174px;
            font-weight: bold;
            font-size: large;
        }
        .style29
        {
            height: 25px;
            width: 174px;
            font-weight: bold;
            font-size: x-large;
        }
        .style30
        {
            font-size: large;
        }
        .style31
        {
            width: 318px;
            height: 25px;
        }
        .style35
        {
            height: 25px;
            width: 174px;
        }
        .style36
        {
            font-size: small;
            width: 318px;
        }
        .style37
        {
            height: 25px;
            width: 425px;
        }
        .style39
        {
            width: 162px;
            height: 25px;
        }
        .style40
        {
            width: 130px;
            height: 25px;
        }
        .style42
        {
            width: 178px;
            height: 25px;
        }
        .style44
        {
            height: 25px;
            width: 174px;
            font-weight: bold;
            color: #FF3300;
        }
        .style45
        {
            width: 230px;
        }
        .style46
        {
            width: 230px;
            height: 25px;
        }
        </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:Panel ID="Panel1" runat="server">
            <img alt="" src="win2000l.gif" style="width: 60px; height: 55px" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <br />
            <asp:Label ID="Title" runat="server" CssClass="style6" Font-Bold="True" 
                Font-Size="Large" style="z-index: 1; left: 84px; top: 38px; position: absolute" 
                Text="Klingon BSR Workflow Tool - Deployer"></asp:Label>
            <br />
        </asp:Panel>
    
    </div>
    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0" 
        EnableViewState="False">
        <asp:View ID="View1" runat="server">
            &nbsp;Search (SID, Last Name, EURC #):&nbsp;
            <asp:TextBox ID="INCSEARCH" runat="server"></asp:TextBox>
            &nbsp;
            <asp:Button ID="SEARCHBUTTON" runat="server" Text="Button" />
            <br />
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AllowSorting="True" AutoGenerateColumns="False" BorderStyle="Solid" 
                CaptionAlign="Top" CssClass="style6" DataKeyNames="incidentId" 
                DataSourceID="SqlDataSource1" EmptyDataText="There are Open Incidents!" 
                EnableViewState="False" Font-Bold="True" HorizontalAlign="Left" PageSize="30">
                <RowStyle Font-Bold="True" Font-Size="X-Small" HorizontalAlign="Center" 
                    VerticalAlign="Middle" />
                <Columns>
                    <asp:TemplateField AccessibleHeaderText="Select" ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                CommandName="Select" onclick="GridView1_SelectedIndexChanged" Text="Select"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="incidentId" HeaderText="Incident ID" 
                        InsertVisible="False" ReadOnly="True" SortExpression="incidentId" />
                    <asp:BoundField DataField="createDate" DataFormatString="{0:MMM d, yyyy}" 
                        HeaderText="Submission Date" ReadOnly="True" SortExpression="createDate" />
                    <asp:BoundField DataField="status" HeaderText="Status" ReadOnly="True" 
                        SortExpression="status" />
                    <asp:BoundField DataField="eurcNumber" HeaderText="EURC Reference" 
                        ReadOnly="True" SortExpression="eurcNumber" />
                    <asp:BoundField DataField="incidentType" HeaderText="Incident Type" 
                        ReadOnly="True" SortExpression="incidentType" />
                    <asp:BoundField DataField="incidentDetailed" HeaderText="Incident Detailed" 
                        SortExpression="incidentDetailed" />
                    <asp:BoundField DataField="assignedSid" HeaderText="Assigned Tech" 
                        SortExpression="assignedSid" />
                    <asp:BoundField DataField="assignedLastName" HeaderText="Tech Last Name" 
                        SortExpression="assignedLastName" />
                    <asp:BoundField DataField="assignedFirstName" HeaderText="Tech First Name" 
                        SortExpression="assignedFirstName" />
                    <asp:BoundField DataField="affectedSid" HeaderText="Client SID" 
                        SortExpression="affectedSid" />
                    <asp:BoundField DataField="affectedLastName" HeaderText="Client Last Name" 
                        SortExpression="affectedLastName" />
                    <asp:BoundField DataField="affectedFirstName" HeaderText="Client First Name" 
                        SortExpression="affectedFirstName" />
                    <asp:BoundField DataField="building" HeaderText="Building Location" 
                        SortExpression="building" />
                    <asp:BoundField DataField="assignedemail" HeaderText="Tech E-Mail" 
                        SortExpression="assignedemail" />
                </Columns>
                <SelectedRowStyle HorizontalAlign="Left" VerticalAlign="Top" Wrap="False" />
                <HeaderStyle BackColor="#003399" Font-Bold="True" Font-Size="XX-Small" 
                    ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <b><span class="style30">
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            <br />
            </span></b>
        </asp:View>
        <asp:View ID="View3" runat="server">
            <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                ConnectionString="<%$ ConnectionStrings:VDIConnectionString %>" 
                
                
                
                SelectCommand="SELECT [incidentId], [eurcNumber], [status], [incidentType], [incidentDetailed], [quantity], [assignedSid], [assignedLastName], [assignedFirstName],[assignedemail], [affectedSid], [affectedLastName], [affectedFirstName], [building], [floor], [city], [state], [phone], [email], [alternateContact], [acPhone], [comments], [createDate] FROM [BVF_Metrics] WHERE ([incidentId] = @incidentId)">
                <SelectParameters>
                    <asp:ControlParameter ControlID="GridView1" Name="incidentId" 
                        PropertyName="SelectedValue" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>
            <asp:FormView ID="FormView1" runat="server" AllowPaging="True" 
                DataSourceID="SqlDataSource3">
                <EditItemTemplate>
                    incidentId:
                    <asp:Label ID="incidentIdLabel1" runat="server" 
                        Text='<%# Eval("incidentId") %>' />
                    <br />
                    eurcNumber:
                    <asp:TextBox ID="eurcNumberTextBox" runat="server" 
                        Text='<%# Bind("eurcNumber") %>' />
                    <br />
                    status:
                    <asp:TextBox ID="statusTextBox" runat="server" Text='<%# Bind("status") %>' />
                    <br />
                    incidentType:
                    <asp:TextBox ID="incidentTypeTextBox" runat="server" 
                        Text='<%# Bind("incidentType") %>' />
                    <br />
                    incidentDetailed:
                    <asp:TextBox ID="incidentDetailedTextBox" runat="server" 
                        Text='<%# Bind("incidentDetailed") %>' />
                    <br />
                    quantity:
                    <asp:TextBox ID="quantityTextBox" runat="server" 
                        Text='<%# Bind("quantity") %>' />
                    <br />
                    assignedSid:
                    <asp:TextBox ID="assignedSidTextBox" runat="server" 
                        Text='<%# Bind("assignedSid") %>' />
                    <br />
                    assignedLastName:
                    <asp:TextBox ID="assignedLastNameTextBox" runat="server" 
                        Text='<%# Bind("assignedLastName") %>' />
                    <br />
                    assignedFirstName:
                    <asp:TextBox ID="assignedFirstNameTextBox" runat="server" 
                        Text='<%# Bind("assignedFirstName") %>' />
                    <br />
                    affectedSid:
                    <asp:TextBox ID="affectedSidTextBox" runat="server" 
                        Text='<%# Bind("affectedSid") %>' />
                    <br />
                    affectedLastName:
                    <asp:TextBox ID="affectedLastNameTextBox" runat="server" 
                        Text='<%# Bind("affectedLastName") %>' />
                    <br />
                    affectedFirstName:
                    <asp:TextBox ID="affectedFirstNameTextBox" runat="server" 
                        Text='<%# Bind("affectedFirstName") %>' />
                    <br />
                    building:
                    <asp:TextBox ID="buildingTextBox" runat="server" 
                        Text='<%# Bind("building") %>' />
                    <br />
                    floor:
                    <asp:TextBox ID="floorTextBox" runat="server" Text='<%# Bind("floor") %>' />
                    <br />
                    city:
                    <asp:TextBox ID="cityTextBox" runat="server" Text='<%# Bind("city") %>' />
                    <br />
                    state:
                    <asp:TextBox ID="stateTextBox" runat="server" Text='<%# Bind("state") %>' />
                    <br />
                    phone:
                    <asp:TextBox ID="phoneTextBox" runat="server" Text='<%# Bind("phone") %>' />
                    <br />
                    email:
                    <asp:TextBox ID="emailTextBox" runat="server" Text='<%# Bind("email") %>' />
                    <br />
                    alternateContact:
                    <asp:TextBox ID="alternateContactTextBox" runat="server" 
                        Text='<%# Bind("alternateContact") %>' />
                    <br />
                    acPhone:
                    <asp:TextBox ID="acPhoneTextBox" runat="server" Text='<%# Bind("acPhone") %>' />
                    <br />
                    comments:
                    <asp:TextBox ID="commentsTextBox" runat="server" 
                        Text='<%# Bind("comments") %>' />
                    <br />
                    createDate:
                    <asp:TextBox ID="createDateTextBox" runat="server" 
                        Text='<%# Bind("createDate") %>' />
                    <br />
                    <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                        CommandName="Update" Text="Update" />
                    &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                        CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                </EditItemTemplate>
                <ItemTemplate>
                    <table class="style9" width="100">
                        <tr>
                            <td class="style29" nowrap="nowrap">
                                Incident Update</td>
                            <td class="style36">
                                &nbsp;</td>
                            <td class="style31" nowrap="nowrap">
                                &nbsp;</td>
                            <td class="style37" nowrap="nowrap">
                                <asp:Button ID="RETINC" runat="server" ForeColor="#009933" Height="30px" 
                                    style="margin-left: 0px" Text="Return to Incidents" Width="150px" 
                                    onclick="ret_inc" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style25" nowrap="nowrap">
                                Incident ID:
                                <asp:Label ID="incid" runat="server" Text='<%# Eval("incidentId") %>'></asp:Label>
                            </td>
                            <td class="style31">
                                <b><span class="style30">EURC:
                                <asp:Label ID="EURC" runat="server" Text='<%# Eval("eurcNumber") %>'></asp:Label>
                                &nbsp;Quantity: </span>
                                <asp:TextBox ID="qbox" runat="server" Height="22px" Width="30px">1</asp:TextBox>
                                </b></td>
                            <td class="style31" nowrap="nowrap">
                                <b><span class="style30">Submission: </span></b><b><span class="style30">
                                <asp:Label ID="SUBDATE" runat="server" Text='<%# Eval("createDate") %>'></asp:Label>
                                </span></b>
                            </td>
                            <td class="style37">
                                <b><span class="style30">Status:&nbsp;
                                <asp:DropDownList ID="STATUSDDL" runat="server" 
                                    SelectedValue='<%# Eval("status") %>'>
                                    <asp:ListItem></asp:ListItem>
                                    <asp:ListItem>NEW</asp:ListItem>
                                    <asp:ListItem>IN PROGRESS</asp:ListItem>
                                    <asp:ListItem>PENDING</asp:ListItem>
                                    <asp:ListItem>COMPLETE</asp:ListItem>
                                    <asp:ListItem>REOPEN-IF</asp:ListItem>
                                </asp:DropDownList>
                                </span></b>
                            </td>
                        </tr>
                        <tr>
                            <td class="style35" nowrap="nowrap">
                                Type:
                                <asp:DropDownList ID="ITDDL" runat="server" 
                                    SelectedValue='<%# Eval("incidentType") %>'>
                                    <asp:ListItem></asp:ListItem>
                                    <asp:ListItem>BUILDER</asp:ListItem>
                                    <asp:ListItem>COORDINATOR</asp:ListItem>
                                    <asp:ListItem>DEPLOYER</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td class="style31" nowrap="nowrap">
                                Type Detailed:&nbsp;
                                <asp:DropDownList ID="IDDDL" runat="server" 
                                    SelectedValue='<%# Eval("incidentDetailed") %>'>
                                    <asp:ListItem></asp:ListItem>
                                    <asp:ListItem>BUILD VDI</asp:ListItem>
                                    <asp:ListItem>BUILD DESKTOP/LAPTOP</asp:ListItem>
                                    <asp:ListItem>INVENTORY MGMT</asp:ListItem>
                                    <asp:ListItem>LDR</asp:ListItem>
                                    <asp:ListItem>COORDINATE BUILD</asp:ListItem>
                                    <asp:ListItem>COORDINATE INSTALL</asp:ListItem>
                                    <asp:ListItem>COORDINATE PROJECT</asp:ListItem>
                                    <asp:ListItem>DEPLOY HW</asp:ListItem>
                                    <asp:ListItem>DEPLOY SW</asp:ListItem>
                                    <asp:ListItem>BLACKBERRY</asp:ListItem>
                                    <asp:ListItem>PRINTER</asp:ListItem>
                                    <asp:ListItem>PROFILE</asp:ListItem>
                                    <asp:ListItem>PURCHASE</asp:ListItem>
                                    <asp:ListItem>OTHER</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td class="style31" nowrap="nowrap">
                                Assigned SID:
                                <asp:TextBox ID="ATECH" runat="server" Height="21px" 
                                    Text='<%# Eval("assignedSid") %>' Width="77px"></asp:TextBox>
                                &nbsp;<asp:Button ID="Button1" runat="server" Height="21px" 
                                    onclick="change_assigned" Text="Get" Width="42px" />
                            </td>
                            <td class="style37">
                                <asp:TextBox ID="TFN" runat="server" Text='<%# Eval("assignedFirstName") %>'></asp:TextBox>
                                &nbsp;
                                <asp:TextBox ID="TLN" runat="server" Text='<%# Eval("assignedLastName") %>'></asp:TextBox>
                                &nbsp;<br />
                                <asp:TextBox ID="temail" runat="server" Text='<%# Eval("assignedemail") %>' 
                                    Width="262px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="style35" nowrap="nowrap">
                                Client Info:&nbsp;
                                <asp:TextBox ID="CSID" runat="server" Height="21px" 
                                    Text='<%# Eval("affectedSid") %>' Width="77px"></asp:TextBox>
                            </td>
                            <td class="style31" nowrap="nowrap">
                                &nbsp;<asp:Button ID="getclient" runat="server" Height="21px" onclick="getclient" 
                                    Text="Get" Width="42px" />
                                &nbsp;
                                <asp:Label ID="CFN" runat="server" Text='<%# Eval("affectedFirstName") %>'></asp:Label>
                                &nbsp;
                                <asp:Label ID="CLN" runat="server" Text='<%# Eval("affectedLastName") %>'></asp:Label>
                            </td>
                            <td class="style31" nowrap="nowrap">
                                <asp:Label ID="BUILDING" runat="server" Text='<%# Eval("building") %>'></asp:Label>
                                &nbsp;
                                <asp:Label ID="FLOOR" runat="server" Text='<%# Eval("floor") %>'></asp:Label>
                            </td>
                            <td class="style37">
                                <asp:Label ID="CITY" runat="server" Text='<%# Eval("city") %>'></asp:Label>
                                ,
                                <asp:Label ID="STATE" runat="server" Text='<%# Eval("state") %>'></asp:Label>
                            </td>
                        </tr>
                        <tr valign="middle">
                            <td class="style35" nowrap="nowrap">
                                <asp:Label ID="PHONE" runat="server" Text='<%# Eval("phone") %>'></asp:Label>
                            </td>
                            <td class="style31">
                                <asp:Label ID="EMAIL" runat="server" Text='<%# Eval("email") %>'></asp:Label>
                            </td>
                            <td class="style31">
                                Alternate:
                                <asp:Label ID="ALTCONTACT" runat="server" 
                                    Text='<%# Eval("alternateContact") %>'></asp:Label>
                            </td>
                            <td class="style37">
                                Alt Phone:
                                <asp:Label ID="ACPHONE" runat="server" Text='<%# Eval("acPhone") %>'></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="style35" nowrap="nowrap">
                                Build Type:</td>
                            <td class="style31" nowrap="nowrap">
                                <asp:Button ID="DEPLOYHW" runat="server" Height="30px" Text="Deploy Hardware" 
                                    Width="150px" onclick="DTBUILD_GO" />
                                &nbsp;<asp:Button ID="PROFVDI" runat="server" Height="30px" 
                                    onclick="VDIBUILD_GO" Text="Profile VDI DT/LT" Width="150px" />
                            </td>
                            <td class="style31">
                                <asp:Button ID="BLACKBERRY" runat="server" Height="30px" onclick="bb_form" 
                                    Text="Install Blackberry" Width="150px" />
                                &nbsp;<asp:Button ID="SOFTWARE" runat="server" Height="30px" onclick="COOR_SW" 
                                    Text="Install Software" Width="150px" />
                            </td>
                            <td class="style37">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td class="style35" nowrap="nowrap">
                                Comments:</td>
                            <td class="style31">
                                <asp:TextBox ID="COMMENTS" runat="server" TextMode="MultiLine" Width="286px" 
                                    Text='<%# Eval("comments") %>'></asp:TextBox>
                            </td>
                            <td class="style31">
                                <asp:Button ID="ACKNOWLEDGE" runat="server" BorderColor="#FF3300" 
                                    BorderStyle="Inset" ForeColor="#FF3300" Height="30px" onclick="acknowledge" 
                                    Text="Acknowledge Incident" Width="150px" />
                                &nbsp;<asp:Button ID="IUIU" runat="server" BorderColor="#FF3300" BorderStyle="Inset" 
                                    ForeColor="Red" Height="30px" onclick="IUIU_Click" Text="Update Incident" 
                                    Width="150px" />
                            </td>
                            <td class="style37">
                                &nbsp;</td>
                        </tr>
                    </table>
                </ItemTemplate>
            </asp:FormView>
        </asp:View>
        <asp:View ID="View4" runat="server">
            <asp:Label ID="Label3" runat="server" Font-Bold="True" Font-Size="Large" 
                Text="Profile &amp; (Soft) Deploy VDI and Desktop/Laptop Form"></asp:Label>
            &nbsp;&nbsp;<asp:Label ID="emailOK" runat="server"></asp:Label><asp:Label 
                ID="tlfn" runat="server" Visible="False"></asp:Label>&nbsp;<asp:Label 
                ID="tlln" runat="server" Visible="False"></asp:Label><asp:Label 
                ID="TLEMAIL" runat="server" style="height: 22px" Visible="False"></asp:Label><br />
            <b>Hostname:</b>&nbsp;&nbsp;<asp:TextBox ID="vdisite" runat="server" Width="141px"></asp:TextBox>&nbsp;<b>IP 
            Address:</b>
            <asp:TextBox ID="vdisubsite" runat="server" Width="141px"></asp:TextBox>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:LinkButton ID="BACK" runat="server">Back to Incident Update</asp:LinkButton><br />
            <b>Name:</b>
            <asp:Label ID="CFN" runat="server"></asp:Label>
&nbsp;<asp:Label ID="CLN" runat="server"></asp:Label>&nbsp;<b>SID:</b>
            <asp:Label ID="VDICSID" runat="server"></asp:Label>
            &nbsp;<table class="style8">
                <tr>
                    <td class="style15" nowrap="nowrap">
                        VDI Profile Status:</td>
                    <td class="style15">
                        <asp:DropDownList ID="VDIPROFSTATDDL" runat="server">
                            <asp:ListItem></asp:ListItem>
                            <asp:ListItem>NEW</asp:ListItem>
                            <asp:ListItem>IN PROGRESS</asp:ListItem>
                            <asp:ListItem>PENDING</asp:ListItem>
                            <asp:ListItem>COMPLETE</asp:ListItem>
                            <asp:ListItem>LOB DESKTOP</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td class="style42">
                        VDI (Soft) Deploy Status:</td>
                    <td class="style12">
                        <asp:DropDownList ID="VDIDEPSTATDDL" runat="server">
                            <asp:ListItem></asp:ListItem>
                            <asp:ListItem>NEW</asp:ListItem>
                            <asp:ListItem>IN PROGRESS</asp:ListItem>
                            <asp:ListItem>PENDING</asp:ListItem>
                            <asp:ListItem>COMPLETE</asp:ListItem>
                            <asp:ListItem>LOB DESKTOP</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="style15" nowrap="nowrap">
                        Desktop/Laptop Profile Status:</td>
                    <td class="style15">
                        <asp:DropDownList ID="DTPROFSTATDDL" runat="server">
                            <asp:ListItem></asp:ListItem>
                            <asp:ListItem>NEW</asp:ListItem>
                            <asp:ListItem>IN PROGRESS</asp:ListItem>
                            <asp:ListItem>PENDING</asp:ListItem>
                            <asp:ListItem>LOB DESKTOP</asp:ListItem>
                            <asp:ListItem>COMPLETE</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td class="style42">
                        UAT Status:</td>
                    <td class="style12">
                        <asp:DropDownList ID="VDIUATSTATDDL" runat="server">
                            <asp:ListItem></asp:ListItem>
                            <asp:ListItem>NEW</asp:ListItem>
                            <asp:ListItem>IN PROGRESS</asp:ListItem>
                            <asp:ListItem>PENDING</asp:ListItem>
                            <asp:ListItem>COMPLETE</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="style15" nowrap="nowrap">
                        Initiate Client UAT:</td>
                    <td class="style15">
                        <asp:Button ID="CLIENTUAT" runat="server" Height="25px" Text="Client UAT" 
                            Width="141px" />
                    </td>
                    <td class="style42">
                        Deploy (Soft) VDI:</td>
                    <td class="style12">
                        <asp:Button ID="DEPVDISOFT" runat="server" Height="25px" Text="Deploy VDI" 
                            Width="141px" />
                    </td>
                </tr>
                <tr>
                    <td class="style15" nowrap="nowrap">
                        <asp:Label ID="rettouptxt" runat="server" ForeColor="Red" style="height: 22px" 
                            Text="Return to Incident Update:"></asp:Label>
                    </td>
                    <td class="style15">
                        <asp:Button ID="VDIINCUP" runat="server" ForeColor="Red" Height="25px" 
                            Text="Incident Update" Width="141px" />
                    </td>
                    <td class="style42">
                        <asp:Label ID="opencoortxt" runat="server" style="height: 22px" 
                            Text="Open New Incident:"></asp:Label>
                    </td>
                    <td class="style12">
                        <asp:Button ID="COORINC" runat="server" Height="25px" Text="New Incident" 
                            Width="141px" />
                    </td>
                </tr>
            </table>
            
            Client Application Information:<br />
            <br />
            <iframe ID="BVF" height="500" name="I1" 
                src="http://gcsweb.jpmorganchase.com/bvf/bysid.asp" width="100%">
            <p>
                Your browser does not support iframes.</p>
            </iframe>
            <br />
        </asp:View>
        <asp:View ID="View5" runat="server">
            <b><span class="style30">Deploy Hardware</span></b><span class="style19">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:LinkButton ID="BACK1" runat="server" Font-Size="Medium">Back to Incident Update</asp:LinkButton>
            </span>
            <br />
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <br />
            <table class="style8">
                <tr>
                    <td class="style24" nowrap="nowrap" valign="middle">
                        Hardware (If Applicable):</td>
                    <td class="style45" nowrap="nowrap">
                        Type:
                        <asp:Label ID="DEPHWTYPE" runat="server"></asp:Label>
                    </td>
                    <td class="style18" nowrap="nowrap">
                        Model:
                        <asp:Label ID="DEPHWMODEL" runat="server"></asp:Label>
                    </td>
                    <td>
                        Location:&nbsp;<asp:Label ID="DEPHWLOC" runat="server"></asp:Label></td>
                </tr>
                <tr>
                    <td class="style23" nowrap="nowrap" valign="middle">
                        &nbsp;</td>
                    <td class="style45" nowrap="nowrap">
                        Rack:&nbsp;<asp:Label ID="DEPHWRACK" runat="server"></asp:Label></td>
                    <td class="style18" nowrap="nowrap">
                        Serial Number:</td>
                    <td>
                        <asp:Label ID="DEPHWSERIAL" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="style35" nowrap="nowrap">
                        Client Info:&nbsp;
                        <asp:Label ID="DEPCSID" runat="server" Text='<%# Eval("affectedSid") %>'></asp:Label>
                    </td>
                    <td class="style46" nowrap="nowrap">
                        <asp:Label ID="DEPCFN" runat="server" Text='<%# Eval("affectedFirstName") %>'></asp:Label>
                        &nbsp;
                        <asp:Label ID="DEPCLN" runat="server" Text='<%# Eval("affectedLastName") %>'></asp:Label>
                    </td>
                    <td class="style31" nowrap="nowrap">
                        <asp:Label ID="DEPBUILDING" runat="server" Text='<%# Eval("building") %>'></asp:Label>
                        &nbsp;
                        <asp:Label ID="DEPFLOOR" runat="server" Text='<%# Eval("floor") %>'></asp:Label>
                    </td>
                    <td class="style37">
                        <asp:Label ID="DEPCITY" runat="server" Text='<%# Eval("city") %>'></asp:Label>
                        ,
                        <asp:Label ID="DEPSTATE" runat="server" Text='<%# Eval("state") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="style35" nowrap="nowrap">
                        <asp:Label ID="DEPPHONE" runat="server" Text='<%# Eval("phone") %>'></asp:Label>
                    </td>
                    <td class="style46">
                        <asp:Label ID="DEPEMAIL" runat="server" Text='<%# Eval("email") %>'></asp:Label>
                    </td>
                    <td class="style31">
                        Alternate:
                        <asp:Label ID="DEPALTCONTACT" runat="server" 
                            Text='<%# Eval("alternateContact") %>'></asp:Label>
                    </td>
                    <td class="style37">
                        Alt Phone:
                        <asp:Label ID="DEPACPHONE" runat="server" Text='<%# Eval("acPhone") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="style35" nowrap="nowrap">
                        VDI HW Deployment Status:</td>
                    <td class="style46">
                        <asp:DropDownList ID="VDIHWDEPSTATDDL" runat="server">
                            <asp:ListItem></asp:ListItem>
                            <asp:ListItem>NEW</asp:ListItem>
                            <asp:ListItem>IN PROGRESS</asp:ListItem>
                            <asp:ListItem>PENDING</asp:ListItem>
                            <asp:ListItem>COMPLETE</asp:ListItem>
                            <asp:ListItem>LOB DESKTOP</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td class="style31">
                        Desktop/Laptop Deployment Status:</td>
                    <td class="style37">
                        <asp:DropDownList ID="DTDEPSTATDDL" runat="server">
                            <asp:ListItem></asp:ListItem>
                            <asp:ListItem>NEW</asp:ListItem>
                            <asp:ListItem>IN PROGRESS</asp:ListItem>
                            <asp:ListItem>PENDING</asp:ListItem>
                            <asp:ListItem>COMPLETE</asp:ListItem>
                            <asp:ListItem>LOB DESKTOP</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="style40" nowrap="nowrap">
                        <asp:Label ID="rettouptxt1" runat="server" ForeColor="Red" style="height: 22px" 
                            Text="Return to Incident Update:"></asp:Label>
                    </td>
                    <td class="style46">
                        <asp:Button ID="IUDTLT" runat="server" ForeColor="Red" Height="25px" 
                            Text="Incident Update" Width="141px" />
                    </td>
                    <td class="style39">
                        <asp:Label ID="opencoortxt1" runat="server" style="height: 22px" 
                            Text="Open New Incident:"></asp:Label>
                    </td>
                    <td class="style12">
                        <asp:Button ID="COORINCDTLT" runat="server" Height="25px" Text="New Incident" 
                            Width="141px" />
                    </td>
                </tr>
            </table>
            <br />
        </asp:View>
        <asp:View ID="View6" runat="server">
            <br />
            <br />
        </asp:View>
        <asp:View ID="View7" runat="server">
            <span class="style19">New Incident&nbsp; </span>
            <asp:Label ID="oldatechsid" runat="server" Visible="False"></asp:Label>
            <br />
            <table style="width:100%;">
                <tr>
                    <td class="style23" nowrap="nowrap" valign="middle">
                        Incident ID:
                        <asp:Label ID="newinc" runat="server" Text='<%# Eval("incidentId") %>'></asp:Label>
                    </td>
                    <td class="style22" nowrap="nowrap">
                        Submission Date:
                        <asp:Label ID="newsub" runat="server" EnableViewState="False" 
                            Text='<%# Eval("createDate") %>'></asp:Label>
                        &nbsp;</td>
                    <td class="style18" nowrap="nowrap">
                        EURC :
                        <asp:Label ID="NEWEURC" runat="server" EnableViewState="False" 
                            Text='<%# Eval("eurcNumber") %>'></asp:Label>
                    </td>
                    <td>
                        Quantity:
                        <asp:TextBox ID="NEWQBOX" runat="server" Text='<%# Bind("quantity") %>' 
                            Width="52px"></asp:TextBox>
                        &nbsp;
                        <asp:LinkButton ID="BACK3" runat="server">Back to Incident Update</asp:LinkButton>
                    </td>
                </tr>
                <tr>
                    <td class="style23" nowrap="nowrap" valign="middle">
                        Status:
                        <asp:DropDownList ID="NEWSTATUSDDL" runat="server" 
                            onselectedindexchanged="INCIDENT_COMPLETE" 
                            SelectedValue='<%# Bind("status") %>' Width="139px">
                            <asp:ListItem></asp:ListItem>
                            <asp:ListItem>NEW</asp:ListItem>
                            <asp:ListItem>PENDING</asp:ListItem>
                            <asp:ListItem>IN PROGRESS</asp:ListItem>
                            <asp:ListItem>COMPLETE</asp:ListItem>
                            <asp:ListItem>REOPEN-IF</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td class="style22" nowrap="nowrap">
                        Assigned SID:
                        <asp:TextBox ID="NEWATECH" runat="server" Text='<%# Bind("assignedSid") %>' 
                            Width="92px"></asp:TextBox>
                        &nbsp;&nbsp;
                        <asp:Button ID="NEWGETSID" runat="server" Font-Size="X-Small" Height="21px" 
                            Text="Change" Width="55px" />
                    </td>
                    <td class="style18" nowrap="nowrap">
                        <asp:TextBox ID="NEWTFN" runat="server" Text='<%# Bind("assignedSid") %>' 
                            Width="92px"></asp:TextBox>
                    </td>
                    <td>
                        <asp:TextBox ID="NEWTLN" runat="server" Text='<%# Bind("assignedSid") %>' 
                            Width="92px"></asp:TextBox>
                        &nbsp;<asp:TextBox ID="NEWTEMAIL" runat="server" Text='<%# Bind("assignedSid") %>' 
                            Width="92px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="style23" nowrap="nowrap" valign="middle">
                        Incident Type:</td>
                    <td class="style22" nowrap="nowrap">
                        <asp:DropDownList ID="NEWITDDL" runat="server" 
                            SelectedValue='<%# Bind("incidentType") %>'>
                            <asp:ListItem></asp:ListItem>
                            <asp:ListItem>BUILDER</asp:ListItem>
                            <asp:ListItem>COORDINATOR</asp:ListItem>
                            <asp:ListItem>DEPLOYER</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td class="style18" nowrap="nowrap">
                        Incident Detailed:</td>
                    <td>
                        <asp:DropDownList ID="NEWIDDDL" runat="server" 
                            SelectedValue='<%# Bind("incidentDetailed") %>'>
                            <asp:ListItem></asp:ListItem>
                            <asp:ListItem>BUILD VDI</asp:ListItem>
                            <asp:ListItem>BUILD DESKTOP/LAPTOP</asp:ListItem>
                            <asp:ListItem>INVENTORY MGMT</asp:ListItem>
                            <asp:ListItem>LDR</asp:ListItem>
                            <asp:ListItem>COORDINATE BUILD</asp:ListItem>
                            <asp:ListItem>COORDINATE INSTALL</asp:ListItem>
                            <asp:ListItem>COORDINATE PROJECT</asp:ListItem>
                            <asp:ListItem>DEPLOY HW</asp:ListItem>
                            <asp:ListItem>DEPLOY SW</asp:ListItem>
                            <asp:ListItem>BLACKBERRY</asp:ListItem>
                            <asp:ListItem>PRINTER</asp:ListItem>
                            <asp:ListItem>PROFILE</asp:ListItem>
                            <asp:ListItem>PURCHASE</asp:ListItem>
                            <asp:ListItem>OTHER</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="style24" nowrap="nowrap" valign="middle">
                        Client Information</td>
                    <td class="style22" nowrap="nowrap">
                        &nbsp;</td>
                    <td class="style18" nowrap="nowrap">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style23" nowrap="nowrap" valign="middle">
                        SID:
                        <asp:Label ID="NEWcsid" runat="server" Text='<%# Eval("affectedSid") %>'></asp:Label>
                    </td>
                    <td class="style22" nowrap="nowrap">
                        Name:
                        <asp:Label ID="NEWCFN" runat="server" Text='<%# Eval("affectedFirstName") %>'></asp:Label>
                        &nbsp;<asp:Label ID="NEWCLN" runat="server" Text='<%# Eval("affectedLastName") %>'></asp:Label></td>
                    <td class="style18" nowrap="nowrap">
                        Client Phone:</td>
                    <td>
                        <asp:Label ID="NEWPHONE" runat="server" Text='<%# Eval("phone") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="style23" nowrap="nowrap" valign="middle">
                        Building Address:</td>
                    <td class="style22" nowrap="nowrap">
                        <asp:Label ID="NEWBUILDING" runat="server" Text='<%# Eval("building") %>'></asp:Label>
                    </td>
                    <td class="style18" nowrap="nowrap">
                        Floor:</td>
                    <td>
                        <asp:Label ID="NEWFLOOR" runat="server" Text='<%# Eval("floor") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="style23" nowrap="nowrap" valign="middle">
                        Client E-Mail:</td>
                    <td class="style22" nowrap="nowrap">
                        <asp:Label ID="NEWEMAIL" runat="server" Text='<%# Eval("email") %>'></asp:Label>
                    </td>
                    <td class="style18" nowrap="nowrap">
                        City</td>
                    <td>
                        <asp:Label ID="NEWCITY" runat="server" Text='<%# Eval("city") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="style23" nowrap="nowrap" valign="middle">
                        State:</td>
                    <td class="style22" nowrap="nowrap">
                        <asp:Label ID="NEWSTATE" runat="server" Text='<%# Eval("state") %>'></asp:Label>
                    </td>
                    <td class="style18" nowrap="nowrap">
                        Alternate Contact:</td>
                    <td>
                        <asp:Label ID="NEWALTCONTACT" runat="server" 
                            Text='<%# Eval("alternateContact") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="style23" nowrap="nowrap" valign="middle">
                        Altternate Phone:</td>
                    <td class="style22" nowrap="nowrap">
                        <asp:Label ID="NEWACPHONE" runat="server" Text='<%# Eval("acPhone") %>'></asp:Label>
                    </td>
                    <td class="style18" nowrap="nowrap">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style24" nowrap="nowrap" valign="middle">
                        Hardware (If Applicable):</td>
                    <td class="style22" nowrap="nowrap">
                        Type:
                        <asp:TextBox ID="NEWHWTYPE" runat="server" Height="18px" Width="116px"></asp:TextBox>
                        &nbsp;&nbsp;&nbsp; </td>
                    <td class="style18" nowrap="nowrap">
                        Model:
                        <asp:TextBox ID="NEWHWMODEL" runat="server" Height="18px" Width="105px"></asp:TextBox>
                    </td>
                    <td>
                        Location:&nbsp;
                        <asp:TextBox ID="NEWHWLOC" runat="server" Height="18px" Width="105px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style23" nowrap="nowrap" valign="middle">
                        &nbsp;</td>
                    <td class="style22" nowrap="nowrap">
                        Rack:&nbsp;
                        <asp:TextBox ID="NEWHWRACK" runat="server" Height="18px" Width="105px"></asp:TextBox>
                    </td>
                    <td class="style18" nowrap="nowrap">
                        Serial Number:</td>
                    <td>
                        <asp:TextBox ID="NEWHWSERIAL" runat="server" Height="18px" Width="199px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style24" nowrap="nowrap" valign="middle">
                        Software (If Applicable):</td>
                    <td class="style22" nowrap="nowrap">
                        Name:
                        <asp:TextBox ID="NEWSWNAME" runat="server" Height="18px" Width="116px"></asp:TextBox>
                    </td>
                    <td class="style18" nowrap="nowrap">
                        Path:</td>
                    <td>
                        <asp:TextBox ID="NEWSWPATH" runat="server" Height="18px" Width="199px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style23" nowrap="nowrap" valign="middle">
                        Comments:</td>
                    <td class="style22" nowrap="nowrap">
                        <asp:TextBox ID="NEWCOMMENTS" runat="server" TextMode="MultiLine"></asp:TextBox>
                    </td>
                    <td class="style18" nowrap="nowrap">
                        <asp:Button ID="NEWINCBUTTON" runat="server" Height="25px" 
                            Text="Create Incident" Width="141px" />
                    </td>
                    <td>
                        <asp:Button ID="NEWBBINC" runat="server" Height="25px" 
                            Text="Create BB Incident" Width="141px" />
                    </td>
                </tr>
            </table>
            <br />
        </asp:View>
        <asp:View ID="View8" runat="server">
            &nbsp;<b><span class="style30">Incident Search Tool</span></b><br />
            Enter Klingon Incident ID, Client SID or Client Last Name below:<br />
            <br />
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            &nbsp;
            <asp:Button ID="Button2" runat="server" Text="Button" />
            <br />
            <br />
            <asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
                AllowSorting="True" AutoGenerateColumns="False" BorderStyle="Solid" 
                CaptionAlign="Top" CssClass="style6" DataKeyNames="incidentId" 
                DataSourceID="SqlDataSource9" EmptyDataText="There are No Open Incidents!" 
                EnableViewState="False" Font-Bold="True" HorizontalAlign="Left">
                <RowStyle Font-Bold="True" Font-Size="X-Small" HorizontalAlign="Center" 
                    VerticalAlign="Middle" />
                <Columns>
                    <asp:TemplateField AccessibleHeaderText="Select" ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                                CommandName="Select" onclick="GridView1_SelectedIndexChanged" Text="Select"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="incidentId" HeaderText="Incident ID" 
                        InsertVisible="False" ReadOnly="True" SortExpression="incidentId">
                        <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="createDate" DataFormatString="{0:MMM d, yyyy}" 
                        HeaderText="Submission Date" ReadOnly="True" SortExpression="createDate">
                        <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="status" HeaderText="Status" ReadOnly="True" 
                        SortExpression="status">
                        <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="eurcNumber" HeaderText="EURC Reference" 
                        ReadOnly="True" SortExpression="eurcNumber">
                        <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="incidentType" HeaderText="Incident Type" 
                        ReadOnly="True" SortExpression="incidentType">
                        <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="incidentDetailed" HeaderText="Incident Detailed" 
                        SortExpression="incidentDetailed">
                        <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="assignedSid" HeaderText="Assigned Tech" 
                        SortExpression="assignedSid">
                        <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="assignedLastName" HeaderText="Tech Last Name" 
                        SortExpression="assignedLastName">
                        <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="assignedFirstName" HeaderText="Tech First Name" 
                        SortExpression="assignedFirstName">
                        <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="affectedSid" HeaderText="Client SID" 
                        SortExpression="affectedSid">
                        <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="affectedLastName" HeaderText="Client Last Name" 
                        SortExpression="affectedLastName">
                        <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="affectedFirstName" HeaderText="Client First Name" 
                        SortExpression="affectedFirstName">
                        <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="building" HeaderText="Building Location" 
                        SortExpression="building">
                        <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="assignedemail" HeaderText="Tech E-Mail" 
                        SortExpression="assignedemail">
                        <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                </Columns>
                <SelectedRowStyle HorizontalAlign="Left" VerticalAlign="Top" Wrap="False" />
                <HeaderStyle BackColor="#003399" Font-Bold="True" Font-Size="XX-Small" 
                    ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
            <br />
            <br />
        </asp:View>
        <asp:View ID="View9" runat="server">
            <asp:Label ID="Label4" runat="server" Font-Bold="True" Font-Size="Large" 
                Text="Install Software"></asp:Label>
            &nbsp;&nbsp;<asp:Label ID="emailOK1" runat="server"></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:LinkButton ID="BACK4" runat="server">Back to Incident Update</asp:LinkButton>
            <br />
            <table class="style9" width="100">
                <tr>
                    <td class="style35" nowrap="nowrap">
                        Client Info:&nbsp;
                        <asp:Label ID="SOFTCSID" runat="server" Text='<%# Eval("affectedSid") %>'></asp:Label>
                    </td>
                    <td class="style31" nowrap="nowrap">
                        <asp:Label ID="SOFTCFN" runat="server" Text='<%# Eval("affectedFirstName") %>'></asp:Label>
                        &nbsp;
                        <asp:Label ID="SOFTCLN" runat="server" Text='<%# Eval("affectedLastName") %>'></asp:Label>
                    </td>
                    <td class="style31" nowrap="nowrap">
                        <asp:Label ID="SOFTBUILDING" runat="server" Text='<%# Eval("building") %>'></asp:Label>
                        &nbsp;
                        <asp:Label ID="SOFTFLOOR" runat="server" Text='<%# Eval("floor") %>'></asp:Label>
                    </td>
                    <td class="style37">
                        <asp:Label ID="SOFTCITY" runat="server" Text='<%# Eval("city") %>'></asp:Label>
                        ,
                        <asp:Label ID="SOFTSTATE" runat="server" Text='<%# Eval("state") %>'></asp:Label>
                    </td>
                </tr>
                <tr valign="middle">
                    <td class="style35" nowrap="nowrap">
                        <asp:Label ID="SOFTPHONE" runat="server" Text='<%# Eval("phone") %>'></asp:Label>
                    </td>
                    <td class="style31">
                        <asp:Label ID="SOFTEMAIL" runat="server" Text='<%# Eval("email") %>'></asp:Label>
                    </td>
                    <td class="style31">
                        Alternate:
                        <asp:Label ID="SOFTALTCONTACT" runat="server" 
                            Text='<%# Eval("alternateContact") %>'></asp:Label>
                    </td>
                    <td class="style37">
                        Alt Phone:
                        <asp:Label ID="SOFTACPHONE" runat="server" Text='<%# Eval("acPhone") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="style35" nowrap="nowrap">
                        Software Name:</td>
                    <td class="style31" nowrap="nowrap">
                        <asp:TextBox ID="SOFTNAME" runat="server" Width="255px"></asp:TextBox>
                    </td>
                    <td class="style31">
                        Path:
                        <asp:TextBox ID="SOFTPATH" runat="server" Width="280px"></asp:TextBox>
                    </td>
                    <td class="style37">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style44" nowrap="nowrap">
                        Must Update First!</td>
                    <td class="style31">
                        Update Incident:
                        <asp:Button ID="SOFTIU" runat="server" ForeColor="Red" Height="25px" 
                            Text="Incident Update" Width="141px" />
                    </td>
                    <td class="style31">
                        &nbsp;Send Install to Client:
                        <asp:Button ID="SOFINCIDENT" runat="server" Height="25px" 
                            Text="Send Client Install" Width="141px" CausesValidation="False" 
                            UseSubmitBehavior="False" />
                    </td>
                    <td class="style37">
                        &nbsp;</td>
                </tr>
            </table>
            &nbsp;
        </asp:View>
        <br />
        <asp:View ID="View10" runat="server">
            <asp:Label ID="Label5" runat="server" Font-Bold="True" Font-Size="Large" 
                Text="Install Blackberry"></asp:Label>
            &nbsp;&nbsp;<asp:Label ID="emailOK2" runat="server"></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:LinkButton ID="BACK5" runat="server">Back to Incident Update</asp:LinkButton>
            <br />
            <table class="style9" width="100">
                <tr>
                    <td class="style35" nowrap="nowrap">
                        Client Info:&nbsp;
                        <asp:Label ID="BBCSID" runat="server" Text='<%# Eval("affectedSid") %>'></asp:Label>
                    </td>
                    <td class="style31" nowrap="nowrap">
                        <asp:Label ID="BBCFN" runat="server" Text='<%# Eval("affectedFirstName") %>'></asp:Label>
                        &nbsp;
                        <asp:Label ID="BBCLN" runat="server" Text='<%# Eval("affectedLastName") %>'></asp:Label>
                    </td>
                    <td class="style31" nowrap="nowrap">
                        <asp:Label ID="BBBUILDING" runat="server" Text='<%# Eval("building") %>'></asp:Label>
                        &nbsp;
                        <asp:Label ID="BBFLOOR" runat="server" Text='<%# Eval("floor") %>'></asp:Label>
                    </td>
                    <td class="style37">
                        <asp:Label ID="BBCITY" runat="server" Text='<%# Eval("city") %>'></asp:Label>
                        ,
                        <asp:Label ID="BBSTATE" runat="server" Text='<%# Eval("state") %>'></asp:Label>
                    </td>
                </tr>
                <tr valign="middle">
                    <td class="style35" nowrap="nowrap">
                        <asp:Label ID="BBPHONE" runat="server" Text='<%# Eval("phone") %>'></asp:Label>
                    </td>
                    <td class="style31">
                        <asp:Label ID="BBEMAIL" runat="server" Text='<%# Eval("email") %>'></asp:Label>
                    </td>
                    <td class="style31">
                        Alternate:
                        <asp:Label ID="BBALTCONTACT" runat="server" 
                            Text='<%# Eval("alternateContact") %>'></asp:Label>
                    </td>
                    <td class="style37">
                        Alt Phone:
                        <asp:Label ID="BBACPHONE" runat="server" Text='<%# Eval("acPhone") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="style35" nowrap="nowrap">
                        Scheduled Date:</td>
                    <td class="style31" nowrap="nowrap">
                        <asp:TextBox ID="BBCOMMENTS" runat="server" TextMode="MultiLine" Width="305px"></asp:TextBox>
                    </td>
                    <td class="style31">
                        &nbsp;</td>
                    <td class="style37">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style44" nowrap="nowrap">
                        Must Update First!</td>
                    <td class="style31">
                        Update Incident:
                        <asp:Button ID="BBIU" runat="server" ForeColor="Red" Height="25px" 
                            Text="Incident Update" Width="141px" />
                    </td>
                    <td class="style31">
                        &nbsp;</td>
                    <td class="style37">
                        &nbsp;</td>
                </tr>
            </table>
            <br />
        </asp:View>
    </asp:MultiView>
    <br />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:VDIConnectionString %>" 
        
        
        
        
        SelectCommand="IF @INCSEARCH IS NULL
BEGIN
SELECT [incidentId], [createDate], [eurcNumber], [status], [incidentType], [incidentDetailed], [assignedSid], [assignedLastName], [assignedFirstName], [assignedemail],[affectedSid], [affectedLastName], [affectedFirstName], [building] FROM [BVF_Metrics] WHERE [incidentType] = @incidentType AND [status] NOT LIKE 'COMPLETE%'  ORDER BY [createDate]
END
ELSE
BEGIN
SELECT [incidentId], [createDate], [eurcNumber], [status], [incidentType], [incidentDetailed], [assignedSid], [assignedLastName], [assignedFirstName], [assignedemail],[affectedSid], [affectedLastName], [affectedFirstName], [building] FROM [BVF_Metrics] WHERE [affectedsid] = @affectedsid OR [affectedlastname]=@affectedlastname OR [eurcnumber]=@eurcnumber AND [status] NOT LIKE 'COMPLETE%'  ORDER BY [createDate]
END">
        <SelectParameters>
            <asp:ControlParameter ControlID="INCSEARCH" Name="incsearch" 
                PropertyName="Text" />
            <asp:Parameter DefaultValue="DEPLOYER" Name="incidentType" Type="String" />
            <asp:ControlParameter ControlID="INCSEARCH" Name="affectedsid" 
                PropertyName="Text" />
            <asp:ControlParameter ControlID="INCSEARCH" Name="affectedlastname" 
                PropertyName="Text" />
            <asp:ControlParameter ControlID="INCSEARCH" Name="eurcnumber" 
                PropertyName="Text" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:VDIConnectionString %>" 
        DeleteCommand="DELETE FROM [BVF_Metrics] WHERE [incidentId] = @incidentId" 
        InsertCommand="INSERT INTO [BVF_Metrics] ([createDate], [eurcNumber], [status], [incidentType], [incidentDetailed], [quantity], [assignedSid], [assignedLastName], [assignedFirstName], [affectedSid], [affectedLastName], [affectedFirstName], [building], [floor], [city], [state], [phone], [email], [alternateContact], [acPhone], [buildSite], [buildSubsite], [clientPW], [sandsVerified], [equipVerified], [ldrSub], [appReportAttached], [clientSupplyPW], [deploySched], [uatSched], [uatStatus], [comments]) VALUES (@createDate, @eurcNumber, @status, @incidentType, @incidentDetailed, @quantity, @assignedSid, @assignedLastName, @assignedFirstName, @affectedSid, @affectedLastName, @affectedFirstName, @building, @floor, @city, @state, @phone, @email, @alternateContact, @acPhone, @buildSite, @buildSubsite, @clientPW, @sandsVerified, @equipVerified, @ldrSub, @appReportAttached, @clientSupplyPW, @deploySched, @uatSched, @uatStatus, @comments)" 
        SelectCommand="SELECT [incidentId], [createDate], [eurcNumber], [status], [incidentType], [incidentDetailed], [quantity], [assignedSid], [assignedEmail], [assignedLastName], [assignedFirstName], [affectedSid], [affectedLastName], [affectedFirstName], [building], [floor], [city], [state], [phone], [email], [alternateContact], [acPhone], [buildSite], [buildSubsite], [clientPW], [sandsVerified], [equipVerified], [ldrSub], [appReportAttached], [clientSupplyPW], [deploySched], [uatSched], [uatStatus], [comments] FROM [BVF_Metrics] WHERE ([incidentId] = @incidentId)" 
        
        
        
        UpdateCommand="UPDATE [BVF_Metrics] SET [createDate] = @createDate, [eurcNumber] = @eurcNumber, [status] = @status, [incidentType] = @incidentType, [incidentDetailed] = @incidentDetailed, [quantity] = @quantity, [assignedSid] = @assignedSid, [assignedLastName] = @assignedLastName, [assignedFirstName] = @assignedFirstName, [affectedSid] = @affectedSid, [affectedLastName] = @affectedLastName, [affectedFirstName] = @affectedFirstName, [building] = @building, [floor] = @floor, [city] = @city, [state] = @state, [phone] = @phone, [email] = @email, [alternateContact] = @alternateContact, [acPhone] = @acPhone, [buildSite] = @buildSite, [buildSubsite] = @buildSubsite, [clientPW] = @clientPW, [sandsVerified] = @sandsVerified, [equipVerified] = @equipVerified, [ldrSub] = @ldrSub, [appReportAttached] = @appReportAttached, [clientSupplyPW] = @clientSupplyPW, [deploySched] = @deploySched, [uatSched] = @uatSched, [uatStatus] = @uatStatus, [comments] = @comments WHERE [incidentId] = @incidentId">
        <SelectParameters>
            <asp:ControlParameter ControlID="GridView1" Name="incidentId" 
                PropertyName="SelectedValue" Type="Int32" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="incidentId" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="createDate" Type="String" />
            <asp:Parameter Name="eurcNumber" Type="String" />
            <asp:Parameter Name="status" Type="String" />
            <asp:Parameter Name="incidentType" Type="String" />
            <asp:Parameter Name="incidentDetailed" Type="String" />
            <asp:Parameter Name="quantity" Type="Int32" />
            <asp:Parameter Name="assignedSid" Type="String" />
            <asp:Parameter Name="assignedLastName" Type="String" />
            <asp:Parameter Name="assignedFirstName" Type="String" />
            <asp:Parameter Name="affectedSid" Type="String" />
            <asp:Parameter Name="affectedLastName" Type="String" />
            <asp:Parameter Name="affectedFirstName" Type="String" />
            <asp:Parameter Name="building" Type="String" />
            <asp:Parameter Name="floor" Type="String" />
            <asp:Parameter Name="city" Type="String" />
            <asp:Parameter Name="state" Type="String" />
            <asp:Parameter Name="phone" Type="String" />
            <asp:Parameter Name="email" Type="String" />
            <asp:Parameter Name="alternateContact" Type="String" />
            <asp:Parameter Name="acPhone" Type="String" />
            <asp:Parameter Name="buildSite" Type="String" />
            <asp:Parameter Name="buildSubsite" Type="String" />
            <asp:Parameter Name="clientPW" Type="String" />
            <asp:Parameter Name="sandsVerified" Type="String" />
            <asp:Parameter Name="equipVerified" Type="String" />
            <asp:Parameter Name="ldrSub" Type="String" />
            <asp:Parameter Name="appReportAttached" Type="String" />
            <asp:Parameter Name="clientSupplyPW" Type="String" />
            <asp:Parameter Name="deploySched" Type="String" />
            <asp:Parameter Name="uatSched" Type="String" />
            <asp:Parameter Name="uatStatus" Type="String" />
            <asp:Parameter Name="comments" Type="String" />
            <asp:Parameter Name="incidentId" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="createDate" Type="String" />
            <asp:Parameter Name="eurcNumber" Type="String" />
            <asp:Parameter Name="status" Type="String" />
            <asp:Parameter Name="incidentType" Type="String" />
            <asp:Parameter Name="incidentDetailed" Type="String" />
            <asp:Parameter Name="quantity" Type="Int32" />
            <asp:Parameter Name="assignedSid" Type="String" />
            <asp:Parameter Name="assignedLastName" Type="String" />
            <asp:Parameter Name="assignedFirstName" Type="String" />
            <asp:Parameter Name="affectedSid" Type="String" />
            <asp:Parameter Name="affectedLastName" Type="String" />
            <asp:Parameter Name="affectedFirstName" Type="String" />
            <asp:Parameter Name="building" Type="String" />
            <asp:Parameter Name="floor" Type="String" />
            <asp:Parameter Name="city" Type="String" />
            <asp:Parameter Name="state" Type="String" />
            <asp:Parameter Name="phone" Type="String" />
            <asp:Parameter Name="email" Type="String" />
            <asp:Parameter Name="alternateContact" Type="String" />
            <asp:Parameter Name="acPhone" Type="String" />
            <asp:Parameter Name="buildSite" Type="String" />
            <asp:Parameter Name="buildSubsite" Type="String" />
            <asp:Parameter Name="clientPW" Type="String" />
            <asp:Parameter Name="sandsVerified" Type="String" />
            <asp:Parameter Name="equipVerified" Type="String" />
            <asp:Parameter Name="ldrSub" Type="String" />
            <asp:Parameter Name="appReportAttached" Type="String" />
            <asp:Parameter Name="clientSupplyPW" Type="String" />
            <asp:Parameter Name="deploySched" Type="String" />
            <asp:Parameter Name="uatSched" Type="String" />
            <asp:Parameter Name="uatStatus" Type="String" />
            <asp:Parameter Name="comments" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource9" runat="server" 
        ConnectionString="<%$ ConnectionStrings:VDIConnectionString %>" 
        
        
        
        
        SelectCommand="SELECT * FROM [BVF_Metrics] WHERE [affectedSid] = @affectedSid OR [affectedLastName] LIKE '%' + @affectedLastName + '%'">
        <SelectParameters>
            <asp:ControlParameter ControlID="INCSEARCH" Name="affectedSid" 
                PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="INCSEARCH" Name="affectedLastName" 
                PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    </form>
</body>
</html>

Open in new window

0
Comment
Question by:donbenson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
13 Comments
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 24739956
That would work in query analyzer as a multiple line query that you could put in a stored procedure or something like that, but as a standalone select statement that is not proper syntax.
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 24739996
Try replacing code on lines 1223-1236 with this code:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:VDIConnectionString %>" 
	SelectCommand="SELECT [incidentId], [createDate], [eurcNumber], [status], [incidentType], [incidentDetailed], [assignedSid], [assignedLastName], [assignedFirstName], [assignedemail],[affectedSid], [affectedLastName], [affectedFirstName], [building] FROM [BVF_Metrics] WHERE ((@INCSEARCH IS NULL AND [incidentType] = @incidentType) OR ([affectedsid] = @affectedsid OR [affectedlastname] = @affectedlastname OR [eurcnumber] = @eurcnumber)) AND [status] NOT LIKE 'COMPLETE%'  ORDER BY [createDate]">

Open in new window

0
 

Author Comment

by:donbenson
ID: 24740013
Can you use a stored procedure to populate a Gridview?
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 60

Expert Comment

by:Kevin Cross
ID: 24740067
0
 

Author Comment

by:donbenson
ID: 24740178
appreciate the help mwvisa1, but got the same results with your code as well.  Issue seems that the gridview will not post the results of the IF NULL part of the query.  Searching with any criteria works fine....Perhaps I will try wrting the stored procedure and see if that will work.
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 24740198
Maybe it is not NULL but empty string ''.  Stored procedure probably won't hurt to try, but you can also try like this:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:VDIConnectionString %>" 
	SelectCommand="SELECT [incidentId], [createDate], [eurcNumber], [status], [incidentType], [incidentDetailed], [assignedSid], [assignedLastName], [assignedFirstName], [assignedemail],[affectedSid], [affectedLastName], [affectedFirstName], [building] FROM [BVF_Metrics] WHERE ((ISNULL(@INCSEARCH, '') = '' AND [incidentType] = @incidentType) OR ([affectedsid] = @affectedsid OR [affectedlastname] = @affectedlastname OR [eurcnumber] = @eurcnumber)) AND [status] NOT LIKE 'COMPLETE%'  ORDER BY [createDate]">

Open in new window

0
 

Author Comment

by:donbenson
ID: 24740257
thanks again, but still the same.  When I test the query in the test query box, it produces exactly what I want, but on the ASP page, nothing...I guess I'll write the SP and see what happens, thanks for your time
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 24740301
Good luck!
0
 
LVL 22

Expert Comment

by:8080_Diver
ID: 24740721
I would receommend using a stored procedure and passing parameters to it.  In the stored proc, you can default the parameter that you fill from the text box to an empty string ('') if it is null and then test for the empty string.
 
Another possible solution is to not worry about swapping between the 2 SELECT statements and, instead, to let the SQL handle it:

SELECT [incidentId], [createDate], [eurcNumber], 
       [status], [incidentType], [incidentDetailed], 
       [assignedSid], [assignedLastName], [assignedFirstName], 
       [assignedemail],[affectedSid], [affectedLastName], 
       [affectedFirstName], [building] 
FROM [BVF_Metrics] 
WHERE (((@INCSEARCH IS NULL) AND
        ([incidentType] = @incidentType)) OR
       ((@INCSEARCH IS NOT NULL) OR
        ([affectedsid] = @affectedsid) OR
        ([eurcnumber]=@eurcnumber)))
    AND ([status] NOT LIKE 'COMPLETE%')  
ORDER BY [createDate]

Open in new window

0
 

Author Comment

by:donbenson
ID: 24743986
OK, I'm at my wits end here.  I have tried this using a SP.  in the SP, I used my original code, mwvisa1's code and 8080 Diver's code and I still get the exact same result as I have been getting.  The frustrating part is that it work absolutely correctly (all ways, with or without SP) in the query test, but will not work on the ASP page.

Attached is my SP (well, the last one that I used)...Regards,
CREATE PROCEDURE Deploy 
	-- Add the parameters for the stored procedure here
	@incsearch nvarchar(200) = NULL, 
	@affectedsid nvarchar(200) = null,
	@affectedlastname nvarchar(200) = null,
	@eurcnumber nvarchar(200) = null,
	@incidenttype nvarchar(200) = null
	
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
 
    -- Insert statements for procedure here
	SELECT [incidentId], [createDate], [eurcNumber], 
[status], [incidentType], [incidentDetailed], [assignedSid],
[assignedLastName], [assignedFirstName], 
[assignedemail],[affectedSid], [affectedLastName], 
[affectedFirstName], [building] FROM [BVF_Metrics]
WHERE ((ISNULL(@INCSEARCH, '') = '' 
AND [incidentType] = @incidentType) OR 
([affectedsid] = @affectedsid OR [affectedlastname] = @affectedlastname OR 
[eurcnumber] = @eurcnumber)) AND [status] NOT LIKE 'COMPLETE%'  
ORDER BY [createDate]
END
GO

Open in new window

0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 24744286
I would debug the ASP.NET page.  Maybe turn tracing on and write trace messages out on what the value of @incsearch and @incidenttype are then see if you can tell what is going wrong by examining the trace.axd.

Regards,
Kevin
0
 

Accepted Solution

by:
donbenson earned 0 total points
ID: 24896969
I figured this one out.  If you add "search" as the default (or any word) you can use the IF ELSE off of that and the code will work as written.
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 24897048
donbenson,

Glad you found a working solution.

Happy coding!

Regards,
isa
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 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