none
SQL 数据库某个表的列太多,网页响应很慢。 RRS feed

  • 问题

  •     在SQL数据库中有个表ReceivableTable,有100列。我用ASP.NET 编写代码,可以在网页中运行,但是响应速度非常慢,甚至网页无响应。因此,我设置了分页功能,还设计了一个DropDownList控件,用DropDownList控件来显示需要显示的列。这样的话,需要显示的列就少了很多,响应速度快些了,但总的来说还是非常慢!想请大家帮忙看看有什么办法可以优化,下面是我的代码,很长但很简单。(代码太长,我分几楼发,估计这是您看到过最长的帖子了。。。)

        代码包括前台、后台、SQL三部分

    ----------------------------前台代码1---------------------------------

    <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Receivable6.aspx.cs" Inherits="ReceivableTable_Receivable6" %>
    
    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
            .style1
            {
                width: 100%;
            }
             .mycontainer td
           {
    
                vertical-align:top;    
           }
        </style>
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <html xmlns="http://www.w3.org/1999/xhtml">
    
       <body>
       <div>
        <script src="http://code.jquery.com/jquery-1.7.2.min.js" type="text/javascript"></script>
            <script type="text/javascript">
                function enter(obj) {
                    var tr = obj.parentNode.parentNode;
                    if (event.keyCode == 40) //向下的时候
                    {
                        if (tr.rowIndex < tr.parentNode.rows.length - 1)
                            tr.parentNode.rows[tr.rowIndex + 1].cells[obj.parentNode.cellIndex].children[0].focus();
                        tr.parentNode.rows[tr.rowIndex + 1].cells[obj.parentNode.cellIndex].children[0].select();
                        return;
                    }
                    if (event.keyCode == 37) //向左的时候
                    {
                        if (obj.parentNode.cellIndex > 0)
                            tr.parentNode.rows[tr.rowIndex].cells[obj.parentNode.cellIndex - 1].children[0].focus();
                        tr.parentNode.rows[tr.rowIndex].cells[obj.parentNode.cellIndex - 1].children[0].select();
                        return;
    
                    }
                    if (event.keyCode == 39) //向右的时候
                    {
                        if (obj.parentNode.cellIndex < tr.cells.length - 1)
                            tr.parentNode.rows[tr.rowIndex].cells[obj.parentNode.cellIndex + 1].children[0].focus();
                        tr.parentNode.rows[tr.rowIndex].cells[obj.parentNode.cellIndex + 1].children[0].select();
                        return;
    
                    }
                    if (event.keyCode == 38) //向上的时候
                    {
                        if (tr.rowIndex > 1)
                            tr.parentNode.rows[tr.rowIndex - 1].cells[obj.parentNode.cellIndex].children[0].focus();
                        tr.parentNode.rows[tr.rowIndex - 1].cells[obj.parentNode.cellIndex].children[0].select();
                        return;
    
                    }
                }</script>    
        
        <table cellpadding="0" cellspacing="0" class="style1">
            <tr>
                <td>
                    年份:<asp:DropDownList ID="DropDownList_Year" runat="server" AutoPostBack="True">
                            <asp:ListItem Selected="True" Value="-1">未选择</asp:ListItem>
                            <asp:ListItem>2012</asp:ListItem>
                            <asp:ListItem>2013</asp:ListItem>
                            <asp:ListItem>2014</asp:ListItem>
                            <asp:ListItem>2015</asp:ListItem>
                        </asp:DropDownList>
                    月份:<asp:DropDownList ID="DropDownList_Month" runat="server" AutoPostBack="True">
                        <asp:ListItem>01</asp:ListItem>
                        <asp:ListItem>02</asp:ListItem>
                        <asp:ListItem>03</asp:ListItem>
                        <asp:ListItem>04</asp:ListItem>
                        <asp:ListItem>05</asp:ListItem>
                        <asp:ListItem>06</asp:ListItem>
                        <asp:ListItem>07</asp:ListItem>
                        <asp:ListItem>08</asp:ListItem>
                        <asp:ListItem>09</asp:ListItem>
                        <asp:ListItem>10</asp:ListItem>
                        <asp:ListItem>11</asp:ListItem>
                        <asp:ListItem>12</asp:ListItem>
                    </asp:DropDownList>
                    所属分公司:<asp:DropDownList ID="DropDownList_BelongToCompanyR" runat="server" 
                            AutoPostBack="True" DataSourceID="SqlDataSource_BelongToCompanyR" 
                            DataTextField="BelongToCompanyR" DataValueField="BelongToCompanyR">
                        </asp:DropDownList>
                        所在城市:<asp:DropDownList ID="DropDownList_PropertyCityR" runat="server" 
                            AutoPostBack="True" DataSourceID="SqlDataSource_PropertyCityR" 
                            DataTextField="PropertyCityR" DataValueField="PropertyCityR">
                        </asp:DropDownList>
                        所在路段:<asp:DropDownList ID="DropDownList_PropertyRoadR" runat="server" 
                            AutoPostBack="True" DataSourceID="SqlDataSource_PropertyRoadR" 
                            DataTextField="PropertyRoadR" DataValueField="PropertyRoadR">
                        </asp:DropDownList>
                        门牌号:<asp:DropDownList ID="DropDownList_PropertyAddressR" runat="server" 
                            AutoPostBack="True" DataSourceID="SqlDataSource_PropertyAddressR" 
                            DataTextField="PropertyAddressR" DataValueField="PropertyAddressR">
                        </asp:DropDownList>
                        承租人:<asp:TextBox ID="TextBox_OppositeSideR" runat="server" AutoPostBack="True"></asp:TextBox>
                        <asp:RadioButton ID="RadioButton_Yes" runat="server" Text="显示" TextAlign="Left" 
                            AutoPostBack="True" GroupName="RadioButton_YesOrNo" 
                            oncheckedchanged="RadioButton_Yes_CheckedChanged" />
                        <asp:RadioButton ID="RadioButton_No" runat="server" Checked="True" Text="隐藏" 
                            TextAlign="Left" AutoPostBack="True" GroupName="RadioButton_YesOrNo" 
                            oncheckedchanged="RadioButton_No_CheckedChanged" />
                        <asp:Button ID="Button_List" runat="server" Text="确定显示" 
                            onclick="Button_List_Click" />
                            <asp:Button ID="Button_Update" runat="server" Text="更        新" 
                            onclick="Button_Update_Click" />
                        
                        <asp:CheckBoxList ID="CheckBoxList_All" runat="server" 
                            RepeatDirection="Horizontal" Font-Size="Smaller" CellPadding="0" 
                            CellSpacing="0">
                            <asp:ListItem Selected="True">序号</asp:ListItem>
                            <asp:ListItem Value="ReceivableID">年份</asp:ListItem>
                            <asp:ListItem Value="PropertyIDR">资产编号</asp:ListItem>
                            <asp:ListItem Value="PRID">ID号</asp:ListItem>
                            <asp:ListItem Value="ContractNumberR" Selected="True">合同编号</asp:ListItem>
                            <asp:ListItem Value="ManageProjectR" Selected="True">经营项目</asp:ListItem>
                            <asp:ListItem Value="PropertyCityR">城市</asp:ListItem>
                            <asp:ListItem Value="PropertyRoadR">路段</asp:ListItem>
                            <asp:ListItem Value="PropertyAddressR">门牌号</asp:ListItem>
                            <asp:ListItem Selected="True" Value="PropertyCRAR">地址</asp:ListItem>
                            <asp:ListItem Selected="True">承租人</asp:ListItem>
                            <asp:ListItem>押金01</asp:ListItem>
                            <asp:ListItem>押金02</asp:ListItem>
                            <asp:ListItem>押金03</asp:ListItem>
                            <asp:ListItem>押金04</asp:ListItem>
                            <asp:ListItem>押金05</asp:ListItem>
                            <asp:ListItem>押金06</asp:ListItem>
                            <asp:ListItem>押金07</asp:ListItem>
                            <asp:ListItem>押金08</asp:ListItem>
                            <asp:ListItem>押金09</asp:ListItem>
                            <asp:ListItem>押金10</asp:ListItem>
                            <asp:ListItem>押金11</asp:ListItem>
                            <asp:ListItem>押金12</asp:ListItem>
                            <asp:ListItem Selected="True">当月押金</asp:ListItem>
                            <asp:ListItem Selected="True">合同起始日</asp:ListItem>
                            <asp:ListItem Selected="True">合同终止日</asp:ListItem>
                            <asp:ListItem>付款方式01</asp:ListItem>
                            <asp:ListItem>付款方式02</asp:ListItem>
                            <asp:ListItem>付款方式03</asp:ListItem>
                            <asp:ListItem>付款方式04</asp:ListItem>
                            <asp:ListItem>付款方式05</asp:ListItem>
                            <asp:ListItem>付款方式06</asp:ListItem>
                            <asp:ListItem>付款方式07</asp:ListItem>
                            <asp:ListItem>付款方式08</asp:ListItem>
                            <asp:ListItem>付款方式09</asp:ListItem>
                            <asp:ListItem>付款方式10</asp:ListItem>
                            <asp:ListItem>付款方式11</asp:ListItem>
                            <asp:ListItem>付款方式12</asp:ListItem>
                            <asp:ListItem Selected="True">付款方式</asp:ListItem>
                            <asp:ListItem>上年欠收</asp:ListItem>
                            <asp:ListItem>01月合同应收</asp:ListItem>
                            <asp:ListItem>02月合同应收</asp:ListItem>
                            <asp:ListItem>03月合同应收</asp:ListItem>
                            <asp:ListItem>04月合同应收</asp:ListItem>
                            <asp:ListItem>05月合同应收</asp:ListItem>
                            <asp:ListItem>06月合同应收</asp:ListItem>
                            <asp:ListItem>07月合同应收</asp:ListItem>
                            <asp:ListItem>08月合同应收</asp:ListItem>
                            <asp:ListItem>09月合同应收</asp:ListItem>
                            <asp:ListItem>10月合同应收</asp:ListItem>
                            <asp:ListItem>11月合同应收</asp:ListItem>
                            <asp:ListItem>12月合同应收</asp:ListItem>
                            <asp:ListItem>01月实收</asp:ListItem>
                            <asp:ListItem>02月实收</asp:ListItem>
                            <asp:ListItem>03月实收</asp:ListItem>
                            <asp:ListItem>04月实收</asp:ListItem>
                            <asp:ListItem Selected="True">05月实收</asp:ListItem>
                            <asp:ListItem>06月实收</asp:ListItem>
                            <asp:ListItem>07月实收</asp:ListItem>
                            <asp:ListItem>08月实收</asp:ListItem>
                            <asp:ListItem>09月实收</asp:ListItem>
                            <asp:ListItem>10月实收</asp:ListItem>
                            <asp:ListItem>11月实收</asp:ListItem>
                            <asp:ListItem>12月实收</asp:ListItem>
                            <asp:ListItem Selected="True">上月欠收</asp:ListItem>
                            <asp:ListItem Selected="True">本月合同应收</asp:ListItem>
                            <asp:ListItem Selected="True">本月总应收</asp:ListItem>
                            <asp:ListItem Selected="True">本月实收</asp:ListItem>
                            <asp:ListItem Selected="True">本月欠收</asp:ListItem>
                            <asp:ListItem>本年合同总应收</asp:ListItem>
                            <asp:ListItem>本年总实收</asp:ListItem>
                            <asp:ListItem Selected="True">01收入</asp:ListItem>
                            <asp:ListItem Selected="True">02收入</asp:ListItem>
                            <asp:ListItem Selected="True">03收入</asp:ListItem>
                            <asp:ListItem Selected="True">04收入</asp:ListItem>
                            <asp:ListItem Selected="True">05收入</asp:ListItem>
                            <asp:ListItem Selected="True">06收入</asp:ListItem>
                            <asp:ListItem Selected="True">07收入</asp:ListItem>
                            <asp:ListItem Selected="True">08收入</asp:ListItem>
                            <asp:ListItem Selected="True">09收入</asp:ListItem>
                            <asp:ListItem Selected="True">10收入</asp:ListItem>
                            <asp:ListItem Selected="True">11收入</asp:ListItem>
                            <asp:ListItem Selected="True">12收入</asp:ListItem>
                            <asp:ListItem Selected="True">总收入</asp:ListItem>
                            <asp:ListItem Selected="True">合同备注</asp:ListItem>
                            <asp:ListItem Selected="True">财务备注</asp:ListItem>
                            <asp:ListItem>01应收至</asp:ListItem>
                            <asp:ListItem>02应收至</asp:ListItem>
                            <asp:ListItem>03应收至</asp:ListItem>
                            <asp:ListItem>04应收至</asp:ListItem>
                            <asp:ListItem>05应收至</asp:ListItem>
                            <asp:ListItem>06应收至</asp:ListItem>
                            <asp:ListItem>07应收至</asp:ListItem>
                            <asp:ListItem>08应收至</asp:ListItem>
                            <asp:ListItem>09应收至</asp:ListItem>
                            <asp:ListItem>10应收至</asp:ListItem>
                            <asp:ListItem>11应收至</asp:ListItem>
                            <asp:ListItem>12应收至</asp:ListItem>
                            <asp:ListItem>01实收至</asp:ListItem>
                            <asp:ListItem>12实收至</asp:ListItem>
                            <asp:ListItem>所属分公司</asp:ListItem>
                            </asp:CheckBoxList>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="GridView_Search" runat="server" 
                        DataSourceID="SqlDataSource_Search" AutoGenerateColumns="False" 
                        DataKeyNames="PRID,ReceivableID,PropertyIDR,ContractNumberR" onrowdatabound="GridView_Search_RowDataBound" 
                            ShowFooter="True"  BackColor="#DEBA84" BorderColor="#DEBA84" 
                        BorderStyle="None" BorderWidth="1px" CellPadding="0" 
                        PageSize="5">
                        <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
                        <Columns>
                                <asp:BoundField DataField="Column1" HeaderText="序号" 
                                    ReadOnly="True" SortExpression="Column1" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="NotSet">
                                <HeaderStyle Font-Size="Smaller" />
                                <ItemStyle Font-Size="Smaller" />
                                </asp:BoundField>
                                    <asp:TemplateField HeaderText="年份" SortExpression="ReceivableID">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_ReceivableID" runat="server" 
                                            Text='<%# Bind("ReceivableID") %>' onkeyup="enter(this)" Width="30px" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" Height="10px" />
                                    <ItemStyle Height="10px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="资产编号" SortExpression="PropertyIDR">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_PropertyIDR" runat="server" 
                                            Text='<%# Bind("PropertyIDR") %>' onkeyup="enter(this)" Width="30px" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="PRID" HeaderText="ID号" InsertVisible="False" 
                                    ReadOnly="True" SortExpression="PRID" >
                                <HeaderStyle Font-Size="Smaller" />
                                <ItemStyle Font-Size="Smaller" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="合同编号" 
                                    SortExpression="ContractNumberR">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_ContractNumberR" runat="server" 
                                            Text='<%# Bind("ContractNumberR") %>' onkeyup="enter(this)" Width="100px" Height="30px" 
                                            TextMode="MultiLine" Font-Size="Smaller" ></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                    </asp:TemplateField>
                                <asp:TemplateField HeaderText="经营项目" SortExpression="ManageProjectR">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_ManageProjectR" runat="server" Text='<%# Bind("ManageProjectR") %>' onkeyup="enter
    
    (this)" Width="50px" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="城市" SortExpression="PropertyCityR">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_PropertyCityR" runat="server" Text='<%# Bind("PropertyCityR") %>' onkeyup="enter
    
    (this)"  Width="30px" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="路段" SortExpression="PropertyRoadR">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_PropertyRoadR" runat="server" Text='<%# Bind("PropertyRoadR") %>' onkeyup="enter
    
    (this)"  Width="30px" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="门牌号" 
                                    SortExpression="PropertyAddressR">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_PropertyAddressR" runat="server" 
                                            Text='<%# Bind("PropertyAddressR") %>' onkeyup="enter(this)"  Width="70px" Height="30px" ></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="地址" SortExpression="PropertyCRAR">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_PropertyCRAR" runat="server" 
                                            Text='<%# Bind("PropertyCRAR") %>' onkeyup="enter(this)"  Width="100px" TextMode="MultiLine" 
                                            Height="30px" Font-Size="Smaller"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="承租人" SortExpression="OppositeSideR">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_OppositeSideR" runat="server" Text='<%# Bind("OppositeSideR") %>' onkeyup="enter
    
    (this)" Width="40px" Height="30px" ></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="押金01" SortExpression="LeaseAssureMoneyR01">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_LeaseAssureMoneyR01" runat="server" 
                                            Text='<%# Bind("LeaseAssureMoneyR01") %>' onkeyup="enter(this)" Width="45px" Height="30px"></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_LeaseAssureMoneyR01" runat="server" 
                                            ControlToValidate="TextBox_LeaseAssureMoneyR01" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="押金02" SortExpression="LeaseAssureMoneyR02">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_LeaseAssureMoneyR02" runat="server" 
                                            Text='<%# Bind("LeaseAssureMoneyR02") %>' onkeyup="enter(this)" Width="45px" Height="30px"></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_LeaseAssureMoneyR02" runat="server" 
                                            ControlToValidate="TextBox_LeaseAssureMoneyR02" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="押金03" SortExpression="LeaseAssureMoneyR03">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_LeaseAssureMoneyR03" runat="server" 
                                            Text='<%# Bind("LeaseAssureMoneyR03") %>' onkeyup="enter(this)" Width="45px" Height="30px"></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_LeaseAssureMoneyR03" runat="server" 
                                            ControlToValidate="TextBox_LeaseAssureMoneyR03" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="押金04" SortExpression="LeaseAssureMoneyR04">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_LeaseAssureMoneyR04" runat="server" 
                                            Text='<%# Bind("LeaseAssureMoneyR04") %>' onkeyup="enter(this)" Width="45px" Height="30px"></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_LeaseAssureMoneyR04" runat="server" 
                                            ControlToValidate="TextBox_LeaseAssureMoneyR04" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="押金05" SortExpression="LeaseAssureMoneyR05">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_LeaseAssureMoneyR05" runat="server" 
                                            Text='<%# Bind("LeaseAssureMoneyR05") %>' onkeyup="enter(this)" Width="45px" Height="30px"></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_LeaseAssureMoneyR05" runat="server" 
                                            ControlToValidate="TextBox_LeaseAssureMoneyR05" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="押金06" SortExpression="LeaseAssureMoneyR06">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_LeaseAssureMoneyR06" runat="server" 
                                            Text='<%# Bind("LeaseAssureMoneyR06") %>' onkeyup="enter(this)" Width="45px" Height="30px"></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_LeaseAssureMoneyR06" runat="server" 
                                            ControlToValidate="TextBox_LeaseAssureMoneyR06" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="押金07" SortExpression="LeaseAssureMoneyR07">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_LeaseAssureMoneyR07" runat="server" 
                                            Text='<%# Bind("LeaseAssureMoneyR07") %>' onkeyup="enter(this)" Width="45px" Height="30px"></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_LeaseAssureMoneyR07" runat="server" 
                                            ControlToValidate="TextBox_LeaseAssureMoneyR07" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="押金08" SortExpression="LeaseAssureMoneyR08">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_LeaseAssureMoneyR08" runat="server" 
                                            Text='<%# Bind("LeaseAssureMoneyR08") %>' onkeyup="enter(this)" Width="45px" Height="30px"></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_LeaseAssureMoneyR08" runat="server" 
                                            ControlToValidate="TextBox_LeaseAssureMoneyR08" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="押金09" SortExpression="LeaseAssureMoneyR09">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_LeaseAssureMoneyR09" runat="server" 
                                            Text='<%# Bind("LeaseAssureMoneyR09") %>' onkeyup="enter(this)" Width="45px" Height="30px"></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_LeaseAssureMoneyR09" runat="server" 
                                            ControlToValidate="TextBox_LeaseAssureMoneyR09" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="押金10" SortExpression="LeaseAssureMoneyR10">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_LeaseAssureMoneyR10" runat="server" 
                                            Text='<%# Bind("LeaseAssureMoneyR10") %>' onkeyup="enter(this)" Width="45px" Height="30px"></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_LeaseAssureMoneyR10" runat="server" 
                                            ControlToValidate="TextBox_LeaseAssureMoneyR10" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="押金11" SortExpression="LeaseAssureMoneyR11">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_LeaseAssureMoneyR11" runat="server" 
                                            Text='<%# Bind("LeaseAssureMoneyR11") %>' onkeyup="enter(this)" Width="45px" Height="30px"></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_LeaseAssureMoneyR11" runat="server" 
                                            ControlToValidate="TextBox_LeaseAssureMoneyR11" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="押金12" SortExpression="LeaseAssureMoneyR12">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_LeaseAssureMoneyR12" runat="server" 
                                            Text='<%# Bind("LeaseAssureMoneyR12") %>' onkeyup="enter(this)" Width="45px" Height="30px"></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_LeaseAssureMoneyR12" runat="server" 
                                            ControlToValidate="TextBox_LeaseAssureMoneyR12" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="当月押金" SortExpression="Expr1">
                                    <ItemTemplate>
                                        <asp:Label ID="Label_Expr1" runat="server" Text='<%# Bind("Expr1") %>' 
                                            Font-Size="Small"></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                    <ItemStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                    
                            <asp:TemplateField HeaderText="合同起始日" SortExpression="LeaseDateFromR">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_LeaseDateFromR" runat="server" 
                                            Text='<%# Eval("LeaseDateFromR","{0:yyyy/MM/dd}") %>' onkeyup="enter(this)" Width="70px" Height="30px" 
    
    ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_LeaseDateFromR" runat="server" 
                                            ControlToValidate="TextBox_LeaseDateFromR" Display="Dynamic" 
                                            ErrorMessage="日期格式错误" Font-Size="XX-Small" Operator="DataTypeCheck" 
    
    Type="Date"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="合同终止日" SortExpression="LeaseDateToR">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_LeaseDateToR" runat="server" Text='<%# Eval("LeaseDateToR","{0:yyyy/MM/dd}") %>' 
    
    onkeyup="enter(this)" 
     Width="70px" Height="30px" ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_LeaseDateToR" runat="server" 
                                            ControlToValidate="TextBox_LeaseDateToR" Display="Dynamic" 
                                            ErrorMessage="日期格式错误" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Date"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="交租方式01" SortExpression="TypeOfPaymentR01">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_TypeOfPaymentR01" runat="server" 
                                            Text='<%# Bind("TypeOfPaymentR01") %>' onkeyup="enter(this)" Width="100px" TextMode="MultiLine" 
                                            Font-Size="Smaller" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="交租方式02" SortExpression="TypeOfPaymentR02">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_TypeOfPaymentR02" runat="server" 
                                            Text='<%# Bind("TypeOfPaymentR02") %>' onkeyup="enter(this)" Width="100px" TextMode="MultiLine" 
                                            Font-Size="Smaller" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="交租方式03" SortExpression="TypeOfPaymentR03">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_TypeOfPaymentR03" runat="server" 
                                            Text='<%# Bind("TypeOfPaymentR03") %>' onkeyup="enter(this)" Width="100px" TextMode="MultiLine" 
                                            Font-Size="Smaller" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="交租方式04" SortExpression="TypeOfPaymentR04">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_TypeOfPaymentR04" runat="server" 
                                            Text='<%# Bind("TypeOfPaymentR04") %>' onkeyup="enter(this)" Width="100px" TextMode="MultiLine" 
                                            Font-Size="Smaller" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="交租方式05" SortExpression="TypeOfPaymentR05">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_TypeOfPaymentR05" runat="server" 
                                            Text='<%# Bind("TypeOfPaymentR05") %>' onkeyup="enter(this)" Width="100px" TextMode="MultiLine" 
                                            Font-Size="Smaller" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="交租方式06" SortExpression="TypeOfPaymentR06">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_TypeOfPaymentR06" runat="server" 
                                            Text='<%# Bind("TypeOfPaymentR06") %>' onkeyup="enter(this)" Width="100px" TextMode="MultiLine" 
                                            Font-Size="Smaller" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="交租方式07" SortExpression="TypeOfPaymentR07">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_TypeOfPaymentR07" runat="server" 
                                            Text='<%# Bind("TypeOfPaymentR07") %>' onkeyup="enter(this)" Width="100px" TextMode="MultiLine" 
                                            Font-Size="Smaller" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="交租方式08" SortExpression="TypeOfPaymentR08">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_TypeOfPaymentR08" runat="server" 
                                            Text='<%# Bind("TypeOfPaymentR08") %>' onkeyup="enter(this)" Width="100px" TextMode="MultiLine" 
                                            Font-Size="Smaller" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="交租方式09" SortExpression="TypeOfPaymentR09">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_TypeOfPaymentR09" runat="server" 
                                            Text='<%# Bind("TypeOfPaymentR09") %>' onkeyup="enter(this)" Width="100px" TextMode="MultiLine" 
                                            Font-Size="Smaller" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="交租方式10" SortExpression="TypeOfPaymentR10">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_TypeOfPaymentR10" runat="server" 
                                            Text='<%# Bind("TypeOfPaymentR10") %>' onkeyup="enter(this)" Width="100px" TextMode="MultiLine" 
                                            Font-Size="Smaller" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="交租方式11" SortExpression="TypeOfPaymentR11">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_TypeOfPaymentR11" runat="server" 
                                            Text='<%# Bind("TypeOfPaymentR11") %>' onkeyup="enter(this)" Width="100px" TextMode="MultiLine" 
                                            Font-Size="Smaller" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="交租方式12" SortExpression="TypeOfPaymentR12">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_TypeOfPaymentR12" runat="server" 
                                            Text='<%# Bind("TypeOfPaymentR12") %>' onkeyup="enter(this)" Width="100px" TextMode="MultiLine" 
                                            Font-Size="Smaller" Height="30px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="交租方式" SortExpression="Expr2">
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Expr2") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("Expr2") %>'></asp:Label>
                                    </EditItemTemplate>
                                    <ControlStyle Font-Size="X-Small" Width="90px" />
                                    <FooterStyle Width="90px" />
                                    <HeaderStyle Font-Size="X-Small" Height="10px" Width="90px" />
                                    <ItemStyle Font-Size="X-Small" Height="10px" Width="9px" />
                                </asp:TemplateField>


    C# 菜鸟中的雏鸟!提的问题也许很幼稚,但我是认真的。希望看在党国的面子上拉兄弟一把!


    2012年5月28日 4:41

答案

全部回复

  • -----------------------前台代码2-----------------------------

    <asp:TemplateField HeaderText="上年欠收" 
                                    SortExpression="FormerOweRentTotal">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_FormerOweRentTotal" runat="server" 
                                            Text='<%# Bind("FormerOweRentTotal") %>' onkeyup="enter(this)" Width="50px" Height="30px" ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_FormerOweRentTotal" runat="server" 
                                            ControlToValidate="TextBox_FormerOweRentTotal" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>    
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="01合同应收" SortExpression="MonthRentR01">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentR01" runat="server" Text='<%# Bind("MonthRentR01") %>' onkeyup="enter(this)" 
    
    Width="45px" Height="30px" ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_MonthRentR01" runat="server" 
                                            ControlToValidate="TextBox_MonthRentR01" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="02合同应收" SortExpression="MonthRentR02">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentR02" runat="server" Text='<%# Bind("MonthRentR02") %>' onkeyup="enter(this)" 
    
    Width="45px" Height="30px" ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_MonthRentR02" runat="server" 
                                            ControlToValidate="TextBox_MonthRentR02" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="03合同应收" SortExpression="MonthRentR03">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentR03" runat="server" Text='<%# Bind("MonthRentR03") %>' onkeyup="enter(this)" 
    
    Width="45px" Height="30px" ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_MonthRentR03" runat="server" 
                                            ControlToValidate="TextBox_MonthRentR03" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="04合同应收" SortExpression="MonthRentR04">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentR04" runat="server" Text='<%# Bind("MonthRentR04") %>' onkeyup="enter(this)" 
    
    Width="45px" Height="30px" ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_MonthRentR04" runat="server" 
                                            ControlToValidate="TextBox_MonthRentR04" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="05合同应收" SortExpression="MonthRentR05">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentR05" runat="server" Text='<%# Bind("MonthRentR05") %>' onkeyup="enter(this)" 
    
    Width="45px" Height="30px" ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_MonthRentR05" runat="server" 
                                            ControlToValidate="TextBox_MonthRentR05" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="06合同应收" SortExpression="MonthRentR06">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentR06" runat="server" Text='<%# Bind("MonthRentR06") %>' onkeyup="enter(this)" 
    
    Width="45px" Height="30px" ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_MonthRentR06" runat="server" 
                                            ControlToValidate="TextBox_MonthRentR06" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="07合同应收" SortExpression="MonthRentR07">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentR07" runat="server" Text='<%# Bind("MonthRentR07") %>' onkeyup="enter(this)" 
    
    Width="45px" Height="30px" ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_MonthRentR07" runat="server" 
                                            ControlToValidate="TextBox_MonthRentR07" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="08合同应收" SortExpression="MonthRentR08">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentR08" runat="server" Text='<%# Bind("MonthRentR08") %>' onkeyup="enter(this)" 
    
    Width="45px" Height="30px" ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_MonthRentR08" runat="server" 
                                            ControlToValidate="TextBox_MonthRentR08" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="09合同应收" SortExpression="MonthRentR09">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentR09" runat="server" Text='<%# Bind("MonthRentR09") %>' onkeyup="enter(this)" 
    
    Width="45px" Height="30px" ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_MonthRentR09" runat="server" 
                                            ControlToValidate="TextBox_MonthRentR09" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="10合同应收" SortExpression="MonthRentR10">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentR10" runat="server" Text='<%# Bind("MonthRentR10") %>' onkeyup="enter(this)" 
    
    Width="45px" Height="30px" ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_MonthRentR10" runat="server" 
                                            ControlToValidate="TextBox_MonthRentR10" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="11合同应收" SortExpression="MonthRentR11">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentR11" runat="server" Text='<%# Bind("MonthRentR11") %>' onkeyup="enter(this)" 
    
    Width="45px" Height="30px" ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_MonthRentR11" runat="server" 
                                            ControlToValidate="TextBox_MonthRentR11" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="12合同应收" SortExpression="MonthRentR12">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentR12" runat="server" Text='<%# Bind("MonthRentR12") %>' onkeyup="enter(this)" 
    
    Width="45px" Height="30px" ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_MonthRentR12" runat="server" 
                                            ControlToValidate="TextBox_MonthRentR12" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="01实收" 
                                    SortExpression="MonthRentPaid01">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentPaid01" runat="server" 
                                            Text='<%# Bind("MonthRentPaid01") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentPaid01" runat="server" 
                                            ControlToValidate="TextBox_MonthRentPaid01" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="02实收" 
                                    SortExpression="MonthRentPaid02">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentPaid02" runat="server" 
                                            Text='<%# Bind("MonthRentPaid02") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentPaid02" runat="server" 
                                            ControlToValidate="TextBox_MonthRentPaid02" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="03实收" 
                                    SortExpression="MonthRentPaid03">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentPaid03" runat="server" 
                                            Text='<%# Bind("MonthRentPaid03") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentPaid03" runat="server" 
                                            ControlToValidate="TextBox_MonthRentPaid03" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="04实收" 
                                    SortExpression="MonthRentPaid04">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentPaid04" runat="server" 
                                            Text='<%# Bind("MonthRentPaid04") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentPaid04" runat="server" 
                                            ControlToValidate="TextBox_MonthRentPaid04" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="05实收" 
                                    SortExpression="MonthRentPaid05">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentPaid05" runat="server" 
                                            Text='<%# Bind("MonthRentPaid05") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentPaid05" runat="server" 
                                            ControlToValidate="TextBox_MonthRentPaid05" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="06实收" 
                                    SortExpression="MonthRentPaid06">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentPaid06" runat="server" 
                                            Text='<%# Bind("MonthRentPaid06") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentPaid06" runat="server" 
                                            ControlToValidate="TextBox_MonthRentPaid06" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="07实收" 
                                    SortExpression="MonthRentPaid07">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentPaid07" runat="server" 
                                            Text='<%# Bind("MonthRentPaid07") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentPaid07" runat="server" 
                                            ControlToValidate="TextBox_MonthRentPaid07" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="08实收" 
                                    SortExpression="MonthRentPaid08">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentPaid08" runat="server" 
                                            Text='<%# Bind("MonthRentPaid08") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentPaid08" runat="server" 
                                            ControlToValidate="TextBox_MonthRentPaid08" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="09实收" 
                                    SortExpression="MonthRentPaid09">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentPaid09" runat="server" 
                                            Text='<%# Bind("MonthRentPaid09") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentPaid09" runat="server" 
                                            ControlToValidate="TextBox_MonthRentPaid09" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="10实收" 
                                    SortExpression="MonthRentPaid10">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentPaid10" runat="server" 
                                            Text='<%# Bind("MonthRentPaid10") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentPaid10" runat="server" 
                                            ControlToValidate="TextBox_MonthRentPaid10" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="11实收" 
                                    SortExpression="MonthRentPaid11">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentPaid11" runat="server" 
                                            Text='<%# Bind("MonthRentPaid11") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentPaid11" runat="server" 
                                            ControlToValidate="TextBox_MonthRentPaid11" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="12实收" 
                                    SortExpression="MonthRentPaid12">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentPaid12" runat="server" 
                                            Text='<%# Bind("MonthRentPaid12") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentPaid12" runat="server" 
                                            ControlToValidate="TextBox_MonthRentPaid12" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                    <asp:TemplateField HeaderText="上月欠收" SortExpression="Expr3">
                                       <ItemTemplate>
                                            <asp:Label ID="Label_Expr3" runat="server" Font-Size="Smaller" 
                                                Text='<%# Bind("Expr3") %>' Width="50px" ></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Font-Size="Smaller" Width="50px" />
                                        <ItemStyle Font-Size="Small" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="本月合同应收" SortExpression="Expr4">
                                    <ItemTemplate>
                                        <asp:Label ID="Label_Expr4" runat="server" Font-Size="Small" 
                                            Text='<%# Bind("Expr4") %>' Width="50px" ></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" Width="50px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="本月总应收" SortExpression="Expr5">
                                    <ItemTemplate>
                                        <asp:Label ID="Label_Expr5" runat="server" Font-Size="Smaller"  Text='<%# Bind("Expr5") %>' Width="50px" 
    
    ></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" Width="50px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="本月实收" SortExpression="Expr6">
                                    <ItemTemplate>
                                        <asp:Label ID="Label_Expr6" runat="server" Text='<%# Bind("Expr6") %>' 
                                            Font-Size="Smaller" Width="50px" ></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" Width="50px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="本月欠收" SortExpression="Expr7">
                                    <ItemTemplate>
                                        <asp:Label ID="Label_Expr7" runat="server" Text='<%# Bind("Expr7") %>' 
                                            Font-Size="Smaller" Width="50px" ></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" Width="50px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="本年合同总应收" SortExpression="Expr8">
                                    <ItemTemplate>
                                        <asp:Label ID="Label_Expr8" runat="server" Text='<%# Bind("Expr8") %>' 
                                            Font-Size="Smaller" Width="50px" ></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" Width="50px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="本年总实收" SortExpression="Expr9">
                                    <ItemTemplate>
                                        <asp:Label ID="Label_Expr9" runat="server" Text='<%# Bind("Expr9") %>' 
                                            Font-Size="Smaller" Width="50px" ></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" Width="50px" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="01收入" 
                                    SortExpression="Income01">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_Income01" runat="server" 
                                            Text='<%# Bind("Income01") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_Income01" runat="server" 
                                            ControlToValidate="TextBox_Income01" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="02收入" 
                                    SortExpression="Income02">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_Income02" runat="server" 
                                            Text='<%# Bind("Income02") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_Income02" runat="server" 
                                            ControlToValidate="TextBox_Income02" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="03收入" 
                                    SortExpression="Income03">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_Income03" runat="server" 
                                            Text='<%# Bind("Income03") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_Income03" runat="server" 
                                            ControlToValidate="TextBox_Income03" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="04收入" 
                                    SortExpression="Income04">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_Income04" runat="server" 
                                            Text='<%# Bind("Income04") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_Income04" runat="server" 
                                            ControlToValidate="TextBox_Income04" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField> 
                                <asp:TemplateField HeaderText="05收入" 
                                    SortExpression="Income05">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_Income05" runat="server" 
                                            Text='<%# Bind("Income05") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_Income05" runat="server" 
                                            ControlToValidate="TextBox_Income05" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="06收入" 
                                    SortExpression="Income06">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_Income06" runat="server" 
                                            Text='<%# Bind("Income06") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_Income06" runat="server" 
                                            ControlToValidate="TextBox_Income06" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="07收入" 
                                    SortExpression="Income07">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_Income07" runat="server" 
                                            Text='<%# Bind("Income07") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_Income07" runat="server" 
                                            ControlToValidate="TextBox_Income07" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField> 
                                <asp:TemplateField HeaderText="08收入" 
                                    SortExpression="Income08">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_Income08" runat="server" 
                                            Text='<%# Bind("Income08") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_Income08" runat="server" 
                                            ControlToValidate="TextBox_Income08" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="09收入" 
                                    SortExpression="Income09">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_Income09" runat="server" 
                                            Text='<%# Bind("Income09") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_Income09" runat="server" 
                                            ControlToValidate="TextBox_Income09" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="10收入" 
                                    SortExpression="Income10">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_Income10" runat="server" 
                                            Text='<%# Bind("Income10") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_Income10" runat="server" 
                                            ControlToValidate="TextBox_Income10" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="11收入" 
                                    SortExpression="Income11">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_Income11" runat="server" 
                                            Text='<%# Bind("Income11") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_Income11" runat="server" 
                                            ControlToValidate="TextBox_Income11" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField> 
                                <asp:TemplateField HeaderText="12收入" 
                                    SortExpression="Income12">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_Income12" runat="server" 
                                            Text='<%# Bind("Income12") %>' onkeyup="enter(this)" Width="45px" Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_Income12" runat="server" 
                                            ControlToValidate="TextBox_Income12" Display="Dynamic" 
                                            ErrorMessage="请输入整数" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            Type="Integer"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="总收入" SortExpression="Expr10">
                                    <ItemTemplate>
                                        <asp:Label ID="Label_Expr10" runat="server" Font-Size ="Smaller" Text='<%# Bind("Expr10") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="合同备注" 
                                    SortExpression="ContractRemarksR">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_ContractRemarksR" runat="server" 
                                            Text='<%# Bind("ContractRemarksR") %>' onkeyup="enter(this)" TextMode="MultiLine" 
                                            Font-Size="Smaller" Height="30px" Width="100px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>


    C# 菜鸟中的雏鸟!提的问题也许很幼稚,但我是认真的。希望看在党国的面子上拉兄弟一把!

    2012年5月28日 4:47
  • ----------------------------前台代码3---------------------------

    <asp:TemplateField HeaderText="财务备注" 
                                    SortExpression="ReceivableReMarks">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_ReceivableReMarks" runat="server" 
                                            Text='<%# Bind("ReceivableReMarks") %>' onkeyup="enter(this)" TextMode="MultiLine" 
                                            Font-Size="Smaller" Height="30px" Width="100px"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="01月至" 
                                    SortExpression="MonthRentRDate01">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentRDate01" runat="server" 
                                            Text='<%# Eval("MonthRentRDate01","{0:yyyy/MM/dd}") %>' onkeyup="enter(this)" Width="70px" Height="30px" 
    
    ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_MonthRentRDate01" runat="server" 
                                            ControlToValidate="TextBox_MonthRentRDate01" Display="Dynamic" 
                                            ErrorMessage="日期格式错误" Font-Size="XX-Small" Operator="DataTypeCheck" 
    
    Type="Date"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="02月至" 
                                    SortExpression="MonthRentRDate02">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentRDate02" runat="server" 
                                            Text='<%# Eval("MonthRentRDate02","{0:yyyy/MM/dd}") %>' onkeyup="enter(this)" Width="70px" Height="30px" 
    
    ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_MonthRentRDate02" runat="server" 
                                            ControlToValidate="TextBox_MonthRentRDate02" Display="Dynamic" 
                                            ErrorMessage="日期格式错误" Font-Size="XX-Small" Operator="DataTypeCheck" 
    
    Type="Date"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="03月至" 
                                    SortExpression="MonthRentRDate03">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentRDate03" runat="server" 
                                            Text='<%# Eval("MonthRentRDate03","{0:yyyy/MM/dd}") %>' onkeyup="enter(this)" Width="70px" Height="30px" 
    
    ></asp:TextBox>
                                        <asp:CompareValidator ID="CompareValidator_MonthRentRDate03" runat="server" Display="Dynamic" 
                                            ErrorMessage="日期格式错误" Font-Size="XX-Small" Operator="DataTypeCheck" 
                                            ControlToValidate="TextBox_MonthRentRDate03"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="04月至" 
                                    SortExpression="MonthRentRDate04">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentRDate04" runat="server" 
                                            Text='<%# Eval("MonthRentRDate04","{0:yyyy/MM/dd}") %>' onkeyup="enter(this)" Width="70px" Height="30px" 
    
    ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentRDate04" runat="server" 
                                            ControlToValidate="TextBox_MonthRentRDate04" Display="Dynamic" 
                                            ErrorMessage="日期格式错误" Font-Size="XX-Small" Operator="DataTypeCheck" 
    
    Type="Date"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="05月至" 
                                    SortExpression="MonthRentRDate05">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentRDate05" runat="server" 
                                            Text='<%# Eval("MonthRentRDate05","{0:yyyy/MM/dd}") %>' onkeyup="enter(this)" Width="70px" Height="30px" 
    
    ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentRDate05" runat="server" 
                                            ControlToValidate="TextBox_MonthRentRDate05" Display="Dynamic" 
                                            ErrorMessage="日期格式错误" Font-Size="XX-Small" Operator="DataTypeCheck" 
    
    Type="Date"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="06月至" 
                                    SortExpression="MonthRentRDate06">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentRDate06" runat="server" 
                                            Text='<%# Eval("MonthRentRDate06","{0:yyyy/MM/dd}") %>' onkeyup="enter(this)" Width="70px" Height="30px" 
    
    ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentRDate06" runat="server" 
                                            ControlToValidate="TextBox_MonthRentRDate06" Display="Dynamic" 
                                            ErrorMessage="日期格式错误" Font-Size="XX-Small" Operator="DataTypeCheck" 
    
    Type="Date"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="07月至" 
                                    SortExpression="MonthRentRDate07">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentRDate07" runat="server" 
                                            Text='<%# Eval("MonthRentRDate07","{0:yyyy/MM/dd}") %>' onkeyup="enter(this)" Width="70px" Height="30px" 
    
    ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentRDate07" runat="server" 
                                            ControlToValidate="TextBox_MonthRentRDate07" Display="Dynamic" 
                                            ErrorMessage="日期格式错误" Font-Size="XX-Small" Operator="DataTypeCheck" 
    
    Type="Date"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="08月至" 
                                    SortExpression="MonthRentRDate08">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentRDate08" runat="server" 
                                            Text='<%# Eval("MonthRentRDate08","{0:yyyy/MM/dd}") %>' onkeyup="enter(this)" Width="70px" Height="30px" 
    
    ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentRDate08" runat="server" 
                                            ControlToValidate="TextBox_MonthRentRDate08" Display="Dynamic" 
                                            ErrorMessage="日期格式错误" Font-Size="XX-Small" Operator="DataTypeCheck" 
    
    Type="Date"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="09月至" 
                                    SortExpression="MonthRentRDate09">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentRDate09" runat="server" 
                                            Text='<%# Eval("MonthRentRDate09","{0:yyyy/MM/dd}") %>' onkeyup="enter(this)" Width="70px" Height="30px" 
    
    ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentRDate09" runat="server" 
                                            ControlToValidate="TextBox_MonthRentRDate09" Display="Dynamic" 
                                            ErrorMessage="日期格式错误" Font-Size="XX-Small" Operator="DataTypeCheck" 
    
    Type="Date"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="10月至" 
                                    SortExpression="MonthRentRDate10">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentRDate10" runat="server" 
                                            Text='<%# Eval("MonthRentRDate10","{0:yyyy/MM/dd}") %>' onkeyup="enter(this)" Width="70px" Height="30px" 
    
    ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentRDate10" runat="server" 
                                            ControlToValidate="TextBox_MonthRentRDate10" Display="Dynamic" 
                                            ErrorMessage="日期格式错误" Font-Size="XX-Small" Operator="DataTypeCheck" 
    
    Type="Date"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="11月至" 
                                    SortExpression="MonthRentRDate11">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentRDate11" runat="server" 
                                            Text='<%# Eval("MonthRentRDate11","{0:yyyy/MM/dd}") %>' onkeyup="enter(this)" Width="70px" Height="30px" 
    
    ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentRDate11" runat="server" 
                                            ControlToValidate="TextBox_MonthRentRDate11" Display="Dynamic" 
                                            ErrorMessage="日期格式错误" Font-Size="XX-Small" Operator="DataTypeCheck" 
    
    Type="Date"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="12月至" 
                                    SortExpression="MonthRentRDate12">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentRDate12" runat="server" 
                                            Text='<%# Eval("MonthRentRDate12","{0:yyyy/MM/dd}") %>' onkeyup="enter(this)" Width="70px" Height="30px" 
    
    ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentRDate12" runat="server" 
                                            ControlToValidate="TextBox_MonthRentRDate12" Display="Dynamic" 
                                            ErrorMessage="日期格式错误" Font-Size="XX-Small" Operator="DataTypeCheck" 
    
    Type="Date"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="01收入日期" 
                                    SortExpression="MonthRentPaidDate01">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentPaidDate01" runat="server" 
                                            Text='<%# Eval("MonthRentPaidDate01","{0:yyyy/MM/dd}") %>' onkeyup="enter(this)" Width="70px" 
    
    Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentPaidDate01" runat="server" 
                                            ControlToValidate="TextBox_MonthRentPaidDate01" Display="Dynamic" 
                                            ErrorMessage="日期格式错误" Font-Size="XX-Small" Operator="DataTypeCheck" 
    
    Type="Date"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="目前收入日期" 
                                    SortExpression="MonthRentPaidDate12">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox_MonthRentPaidDate12" runat="server" 
                                            Text='<%# Eval("MonthRentPaidDate12","{0:yyyy/MM/dd}") %>' onkeyup="enter(this)" Width="70px" 
     
     
     
     Height="30px" ></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator_MonthRentPaidDate12" 
                                            runat="server" ControlToValidate="TextBox_MonthRentPaidDate12" 
                                            Display="Dynamic" ErrorMessage="日期格式错误" Font-Size="XX-Small" 
                                            Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="所属分公司" 
                                    SortExpression="BelongToCompanyR">
                                    <ItemTemplate>
                                <asp:TextBox ID="TextBox_BelongToCompanyR" runat="server" 
                                            Text='<%# Bind("BelongToCompanyR") %>' onkeyup="enter(this)" Width="70px" Height="30px" ></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle Font-Size="Smaller" />
                                </asp:TemplateField>
                        </Columns>
                        <FooterStyle Font-Size="X-Small" BackColor="#F7DFB5" ForeColor="#8C4510" />
                        <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                    </asp:GridView>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>


    C# 菜鸟中的雏鸟!提的问题也许很幼稚,但我是认真的。希望看在党国的面子上拉兄弟一把!

    2012年5月28日 4:50
  • -----------------------前台代码4--------------------

    <td>
                    <asp:SqlDataSource ID="SqlDataSource_Search" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:长铁物业公司资产数据库ConnectionString %>" 
                        DeleteCommand="DELETE FROM [ReceivableTable] WHERE [PRID] = @PRID" 
                        InsertCommand="INSERT INTO [ReceivableTable] ([ReceivableID], [PropertyIDR], [ContractNumberR], [ManageProjectR], [PropertyCityR], [PropertyRoadR], [PropertyAddressR], [PropertyCRAR], [OppositeSideR], [LeaseAssureMoneyR01], [LeaseAssureMoneyR02], [LeaseAssureMoneyR03], [LeaseAssureMoneyR04], [LeaseAssureMoneyR05], [LeaseAssureMoneyR06], [LeaseAssureMoneyR07], [LeaseAssureMoneyR08], [LeaseAssureMoneyR09], [LeaseAssureMoneyR10], [LeaseAssureMoneyR11], [LeaseAssureMoneyR12], [LeaseDateFromR], [LeaseDateToR], [TypeOfPaymentR01], [TypeOfPaymentR02], [TypeOfPaymentR03], [TypeOfPaymentR04], [TypeOfPaymentR05], [TypeOfPaymentR06], [TypeOfPaymentR07], [TypeOfPaymentR08], [TypeOfPaymentR09], [TypeOfPaymentR10], [TypeOfPaymentR11], [TypeOfPaymentR12], [FormerOweRentTotal], [MonthRentR01], [MonthRentR02], [MonthRentR03], [MonthRentR04], [MonthRentR05], [MonthRentR06], [MonthRentR07], [MonthRentR08], [MonthRentR09], [MonthRentR10], [MonthRentR11], [MonthRentR12], [MonthRentPaid01], [MonthRentPaid02], [MonthRentPaid03], [MonthRentPaid04], [MonthRentPaid05], [MonthRentPaid06], [MonthRentPaid07], [MonthRentPaid08], [MonthRentPaid09], [MonthRentPaid10], [MonthRentPaid11], [MonthRentPaid12], [Income01], [Income02], [Income03], [Income04], [Income05], [Income06], [Income07], [Income08], [Income09], [Income10], [Income11], [Income12], [ContractRemarksR], [ReceivableReMarks], [MonthRentRDate01], [MonthRentRDate02], [MonthRentRDate03], [MonthRentRDate04], [MonthRentRDate05], [MonthRentRDate06], [MonthRentRDate07], [MonthRentRDate08], [MonthRentRDate09], [MonthRentRDate10], [MonthRentRDate11], [MonthRentRDate12], [MonthRentPaidDate01], [MonthRentPaidDate12], [BelongToCompanyR]) VALUES (@ReceivableID, @PropertyIDR, @ContractNumberR, @ManageProjectR, @PropertyCityR, @PropertyRoadR, @PropertyAddressR, @PropertyCRAR, @OppositeSideR, @LeaseAssureMoneyR01, @LeaseAssureMoneyR02, @LeaseAssureMoneyR03, @LeaseAssureMoneyR04, @LeaseAssureMoneyR05, @LeaseAssureMoneyR06, @LeaseAssureMoneyR07, @LeaseAssureMoneyR08, @LeaseAssureMoneyR09, @LeaseAssureMoneyR10, @LeaseAssureMoneyR11, @LeaseAssureMoneyR12, @LeaseDateFromR, @LeaseDateToR, @TypeOfPaymentR01, @TypeOfPaymentR02, @TypeOfPaymentR03, @TypeOfPaymentR04, @TypeOfPaymentR05, @TypeOfPaymentR06, @TypeOfPaymentR07, @TypeOfPaymentR08, @TypeOfPaymentR09, @TypeOfPaymentR10, @TypeOfPaymentR11, @TypeOfPaymentR12, @FormerOweRentTotal, @MonthRentR01, @MonthRentR02, @MonthRentR03, @MonthRentR04, @MonthRentR05, @MonthRentR06, @MonthRentR07, @MonthRentR08, @MonthRentR09, @MonthRentR10, @MonthRentR11, @MonthRentR12, @MonthRentPaid01, @MonthRentPaid02, @MonthRentPaid03, @MonthRentPaid04, @MonthRentPaid05, @MonthRentPaid06, @MonthRentPaid07, @MonthRentPaid08, @MonthRentPaid09, @MonthRentPaid10, @MonthRentPaid11, @MonthRentPaid12, @Income01, @Income02, @Income03, @Income04, @Income05, @Income06, @Income07, @Income08, @Income09, @Income10, @Income11, @Income12, @ContractRemarksR, @ReceivableReMarks, @MonthRentRDate01, @MonthRentRDate02, @MonthRentRDate03, @MonthRentRDate04, @MonthRentRDate05, @MonthRentRDate06, @MonthRentRDate07, @MonthRentRDate08, @MonthRentRDate09, @MonthRentRDate10, @MonthRentRDate11, @MonthRentRDate12, @MonthRentPaidDate01, @MonthRentPaidDate12, @BelongToCompanyR)" 
                        SelectCommand="SELECT ROW_NUMBER ()over(order by getdate()),  ReceivableID, PropertyIDR, PRID, ContractNumberR, ManageProjectR, PropertyCityR, PropertyRoadR, PropertyAddressR, PropertyCRAR, OppositeSideR, LeaseAssureMoneyR01, LeaseAssureMoneyR02, LeaseAssureMoneyR03, LeaseAssureMoneyR04, LeaseAssureMoneyR05, LeaseAssureMoneyR06, LeaseAssureMoneyR07, LeaseAssureMoneyR08, LeaseAssureMoneyR09, LeaseAssureMoneyR10, LeaseAssureMoneyR11, LeaseAssureMoneyR12, (CASE WHEN @month = 01 THEN ISNULL(LeaseAssureMoneyR01 , '0') WHEN @month = 02 THEN ISNULL(LeaseAssureMoneyR02 , '0') WHEN @month = 03 THEN ISNULL(LeaseAssureMoneyR03 , '0') WHEN @month = 04 THEN ISNULL(LeaseAssureMoneyR04 , '0') WHEN @month = 05 THEN ISNULL(LeaseAssureMoneyR05 , '0') WHEN @month = 06 THEN ISNULL(LeaseAssureMoneyR06 , '0') WHEN @month = 07 THEN ISNULL(LeaseAssureMoneyR07 , '0') WHEN @month = 08 THEN ISNULL(LeaseAssureMoneyR08 , '0') WHEN @month = 09 THEN ISNULL(LeaseAssureMoneyR09 , '0') WHEN @month = 10 THEN ISNULL(LeaseAssureMoneyR10 , '0') WHEN @month = 11 THEN ISNULL(LeaseAssureMoneyR11 , '0') WHEN @month = 12 THEN ISNULL(LeaseAssureMoneyR12 , '0') ELSE '0' END) AS Expr1, LeaseDateFromR, LeaseDateToR, TypeOfPaymentR01, TypeOfPaymentR02, TypeOfPaymentR03, TypeOfPaymentR04, TypeOfPaymentR05, TypeOfPaymentR06, TypeOfPaymentR07, TypeOfPaymentR08, TypeOfPaymentR09, TypeOfPaymentR10, TypeOfPaymentR11, TypeOfPaymentR12, (CASE WHEN @month = 01 THEN ISNULL(TypeOfPaymentR01 , '无') WHEN @month = 02 THEN ISNULL(TypeOfPaymentR02 , '无') WHEN @month = 03 THEN ISNULL(TypeOfPaymentR03 , '无') WHEN @month = 04 THEN ISNULL(TypeOfPaymentR04 , '无') WHEN @month = 05 THEN ISNULL(TypeOfPaymentR05 , '无') WHEN @month = 06 THEN ISNULL(TypeOfPaymentR06 , '无') WHEN @month = 07 THEN ISNULL(TypeOfPaymentR07 , '无') WHEN @month = 08 THEN ISNULL(TypeOfPaymentR08 , '无') WHEN @month = 09 THEN ISNULL(TypeOfPaymentR09 , '无') WHEN @month = 10 THEN ISNULL(TypeOfPaymentR10 , '无') WHEN @month = 11 THEN ISNULL(TypeOfPaymentR11 , '无') WHEN @month = 12 THEN ISNULL(TypeOfPaymentR12 , '无') ELSE '无' END) AS Expr2, FormerOweRentTotal, MonthRentR01, MonthRentR02, MonthRentR03, MonthRentR04, MonthRentR05, MonthRentR06, MonthRentR07, MonthRentR08, MonthRentR09, MonthRentR10, MonthRentR11, MonthRentR12, MonthRentPaid01, MonthRentPaid02, MonthRentPaid03, MonthRentPaid04, MonthRentPaid05, MonthRentPaid06, MonthRentPaid07, MonthRentPaid08, MonthRentPaid09, MonthRentPaid10, MonthRentPaid11, MonthRentPaid12, (CASE WHEN @month = 01 THEN ISNULL(FormerOweRentTotal , '0') WHEN @month = 02 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') WHEN @month = 03 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') WHEN @month = 04 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') WHEN @month = 05 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') WHEN @month = 06 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') WHEN @month = 07 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') WHEN @month = 08 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') - ISNULL(MonthRentPaid07 , '0') WHEN @month = 09 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') - ISNULL(MonthRentPaid07 , '0') + ISNULL(MonthRentR08 , '0') - ISNULL(MonthRentPaid08 , '0') WHEN @month = 10 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') - ISNULL(MonthRentPaid07 , '0') + ISNULL(MonthRentR08 , '0') - ISNULL(MonthRentPaid08 , '0') + ISNULL(MonthRentR09 , '0') - ISNULL(MonthRentPaid09 , '0') WHEN @month = 11 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') - ISNULL(MonthRentPaid07 , '0') + ISNULL(MonthRentR08 , '0') - ISNULL(MonthRentPaid08 , '0') + ISNULL(MonthRentR09 , '0') - ISNULL(MonthRentPaid09 , '0') + ISNULL(MonthRentR10 , '0') - ISNULL(MonthRentPaid10 , '0') WHEN @month = 12 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') - ISNULL(MonthRentPaid07 , '0') + ISNULL(MonthRentR08 , '0') - ISNULL(MonthRentPaid08 , '0') + ISNULL(MonthRentR09 , '0') - ISNULL(MonthRentPaid09 , '0') + ISNULL(MonthRentR10 , '0') - ISNULL(MonthRentPaid10 , '0') + ISNULL(MonthRentR11 , '0') - ISNULL(MonthRentPaid11 , '0') ELSE 0 END) AS Expr3, (CASE WHEN @month = 01 THEN ISNULL(MonthRentR01 , '0') WHEN @month = 02 THEN ISNULL(MonthRentR02 , '0') WHEN @month = 03 THEN ISNULL(MonthRentR03 , '0') WHEN @month = 04 THEN ISNULL(MonthRentR04 , '0') WHEN @month = 05 THEN ISNULL(MonthRentR05 , '0') WHEN @month = 06 THEN ISNULL(MonthRentR06 , '0') WHEN @month = 07 THEN ISNULL(MonthRentR07 , '0') WHEN @month = 08 THEN ISNULL(MonthRentR08 , '0') WHEN @month = 09 THEN ISNULL(MonthRentR09 , '0') WHEN @month = 10 THEN ISNULL(MonthRentR10 , '0') WHEN @month = 11 THEN ISNULL(MonthRentR11 , '0') WHEN @month = 12 THEN ISNULL(MonthRentR12 , '0') ELSE '0' END) AS Expr4, (CASE WHEN @month = 01 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') WHEN @month = 02 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') WHEN @month = 03 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') WHEN @month = 04 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') WHEN @month = 05 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') WHEN @month = 06 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') WHEN @month = 07 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') WHEN @month = 08 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') - ISNULL(MonthRentPaid07 , '0') + ISNULL(MonthRentR08 , '0') WHEN @month = 09 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') - ISNULL(MonthRentPaid07 , '0') + ISNULL(MonthRentR08 , '0') - ISNULL(MonthRentPaid08 , '0') + ISNULL(MonthRentR09 , '0') WHEN @month = 10 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') - ISNULL(MonthRentPaid07 , '0') + ISNULL(MonthRentR08 , '0') - ISNULL(MonthRentPaid08 , '0') + ISNULL(MonthRentR09 , '0') - ISNULL(MonthRentPaid09 , '0') + ISNULL(MonthRentR10 , '0') WHEN @month = 11 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') - ISNULL(MonthRentPaid07 , '0') + ISNULL(MonthRentR08 , '0') - ISNULL(MonthRentPaid08 , '0') + ISNULL(MonthRentR09 , '0') - ISNULL(MonthRentPaid09 , '0') + ISNULL(MonthRentR10 , '0') - ISNULL(MonthRentPaid10 , '0') + ISNULL(MonthRentR11 , '0') WHEN @month = 12 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') - ISNULL(MonthRentPaid07 , '0') + ISNULL(MonthRentR08 , '0') - ISNULL(MonthRentPaid08 , '0') + ISNULL(MonthRentR09 , '0') - ISNULL(MonthRentPaid09 , '0') + ISNULL(MonthRentR10 , '0') - ISNULL(MonthRentPaid10 , '0') + ISNULL(MonthRentR11 , '0') - ISNULL(MonthRentPaid11 , '0') + ISNULL(MonthRentR12 , '0') ELSE 0 END) AS Expr5, (CASE WHEN @month = 01 THEN ISNULL(MonthRentPaid01 , '0') WHEN @month = 02 THEN ISNULL(MonthRentPaid02 , '0') WHEN @month = 03 THEN ISNULL(MonthRentPaid03 , '0') WHEN @month = 04 THEN ISNULL(MonthRentPaid04 , '0') WHEN @month = 05 THEN ISNULL(MonthRentPaid05 , '0') WHEN @month = 06 THEN ISNULL(MonthRentPaid06 , '0') WHEN @month = 07 THEN ISNULL(MonthRentPaid07 , '0') WHEN @month = 08 THEN ISNULL(MonthRentPaid08 , '0') WHEN @month = 09 THEN ISNULL(MonthRentPaid09 , '0') WHEN @month = 10 THEN ISNULL(MonthRentPaid10 , '0') WHEN @month = 11 THEN ISNULL(MonthRentPaid11 , '0') WHEN @month = 12 THEN ISNULL(MonthRentPaid12 , '0') ELSE 0 END) AS Expr6, (CASE WHEN @month = 01 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') WHEN @month = 02 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') WHEN @month = 03 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') WHEN @month = 04 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') WHEN @month = 05 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') WHEN @month = 06 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') WHEN @month = 07 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') - ISNULL(MonthRentPaid07 , '0') WHEN @month = 08 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') - ISNULL(MonthRentPaid07 , '0') + ISNULL(MonthRentR08 , '0') - ISNULL(MonthRentPaid08 , '0') WHEN @month = 09 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') - ISNULL(MonthRentPaid07 , '0') + ISNULL(MonthRentR08 , '0') - ISNULL(MonthRentPaid08 , '0') + ISNULL(MonthRentR09 , '0') - ISNULL(MonthRentPaid09 , '0') WHEN @month = 10 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') - ISNULL(MonthRentPaid07 , '0') + ISNULL(MonthRentR08 , '0') - ISNULL(MonthRentPaid08 , '0') + ISNULL(MonthRentR09 , '0') - ISNULL(MonthRentPaid09 , '0') + ISNULL(MonthRentR10 , '0') - ISNULL(MonthRentPaid10 , '0') WHEN @month = 11 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') - ISNULL(MonthRentPaid07 , '0') + ISNULL(MonthRentR08 , '0') - ISNULL(MonthRentPaid08 , '0') + ISNULL(MonthRentR09 , '0') - ISNULL(MonthRentPaid09 , '0') + ISNULL(MonthRentR10 , '0') - ISNULL(MonthRentPaid10 , '0') + ISNULL(MonthRentR11 , '0') - ISNULL(MonthRentPaid11 , '0') WHEN @month = 12 THEN ISNULL(FormerOweRentTotal , '0') + ISNULL(MonthRentR01 , '0') - ISNULL(MonthRentPaid01 , '0') + ISNULL(MonthRentR02 , '0') - ISNULL(MonthRentPaid02 , '0') + ISNULL(MonthRentR03 , '0') - ISNULL(MonthRentPaid03 , '0') + ISNULL(MonthRentR04 , '0') - ISNULL(MonthRentPaid04 , '0') + ISNULL(MonthRentR05 , '0') - ISNULL(MonthRentPaid05 , '0') + ISNULL(MonthRentR06 , '0') - ISNULL(MonthRentPaid06 , '0') + ISNULL(MonthRentR07 , '0') - ISNULL(MonthRentPaid07 , '0') + ISNULL(MonthRentR08 , '0') - ISNULL(MonthRentPaid08 , '0') + ISNULL(MonthRentR09 , '0') - ISNULL(MonthRentPaid09 , '0') + ISNULL(MonthRentR10 , '0') - ISNULL(MonthRentPaid10 , '0') + ISNULL(MonthRentR11 , '0') - ISNULL(MonthRentPaid11 , '0') + ISNULL(MonthRentR12 , '0') - ISNULL(MonthRentPaid12 , '0') ELSE 0 END) AS Expr7, ISNULL(MonthRentR01, '0') + ISNULL(MonthRentR02, '0') + ISNULL(MonthRentR03, '0') + ISNULL(MonthRentR04, '0') + ISNULL(MonthRentR05, '0') + ISNULL(MonthRentR06, '0') + ISNULL(MonthRentR07, '0') + ISNULL(MonthRentR08, '0') + ISNULL(MonthRentR09, '0') + ISNULL(MonthRentR10, '0') + ISNULL(MonthRentR11, '0') + ISNULL(MonthRentR12, '0') AS Expr8, ISNULL(MonthRentPaid01, '0') + ISNULL(MonthRentPaid02, '0') + ISNULL(MonthRentPaid03, '0') + ISNULL(MonthRentPaid04, '0') + ISNULL(MonthRentPaid05, '0') + ISNULL(MonthRentPaid06, '0') + ISNULL(MonthRentPaid07, '0') + ISNULL(MonthRentPaid08, '0') + ISNULL(MonthRentPaid09, '0') + ISNULL(MonthRentPaid10, '0') + ISNULL(MonthRentPaid11, '0') + ISNULL(MonthRentPaid12, '0') AS Expr9, Income01, Income02, Income03, Income04, Income05, Income06, Income07, Income08, Income09, Income10, Income11, Income12, ISNULL(Income01, '0') + ISNULL(Income02, '0') + ISNULL(Income03, '0') + ISNULL(Income04, '0') + ISNULL(Income05, '0') + ISNULL(Income06, '0') + ISNULL(Income07, '0') + ISNULL(Income08, '0') + ISNULL(Income09, '0') + ISNULL(Income10, '0') + ISNULL(Income11, '0') + ISNULL(Income12, '0') AS Expr10, ContractRemarksR, ReceivableReMarks, MonthRentRDate01, MonthRentRDate02, MonthRentRDate03, MonthRentRDate04, MonthRentRDate05, MonthRentRDate06, MonthRentRDate07, MonthRentRDate08, MonthRentRDate09, MonthRentRDate10, MonthRentRDate11, MonthRentRDate12, MonthRentPaidDate01, MonthRentPaidDate12, BelongToCompanyR FROM ReceivableTable WHERE (ISNULL(@ReceivableID, N'') = '-1' OR ReceivableID = @ReceivableID) AND (ISNULL(@BelongToCompanyR, N'') = '未选择' OR BelongToCompanyR = @BelongToCompanyR) AND (ISNULL(@PropertyCityR, N'') = '未选择' OR PropertyCityR = @PropertyCityR) AND (ISNULL(@PropertyRoadR, N'') = '未选择' OR PropertyRoadR = @PropertyRoadR) AND (ISNULL(@PropertyAddressR, N'') = '未选择' OR PropertyAddressR = @PropertyAddressR) AND (ISNULL(@OppositeSideR, N'') = '-1' OR ISNULL(OppositeSideR, N'') LIKE '%' + @OppositeSideR + '%')" 
                        
                        
                        
                        
                        UpdateCommand="UPDATE [ReceivableTable] SET [ReceivableID] = @ReceivableID, [PropertyIDR] = @PropertyIDR, [ContractNumberR] = @ContractNumberR, [ManageProjectR] = @ManageProjectR, [PropertyCityR] = @PropertyCityR, [PropertyRoadR] = @PropertyRoadR, [PropertyAddressR] = @PropertyAddressR, [PropertyCRAR] = @PropertyCRAR, [OppositeSideR] = @OppositeSideR, [LeaseAssureMoneyR01] = @LeaseAssureMoneyR01, [LeaseAssureMoneyR02] = @LeaseAssureMoneyR02, [LeaseAssureMoneyR03] = @LeaseAssureMoneyR03, [LeaseAssureMoneyR04] = @LeaseAssureMoneyR04, [LeaseAssureMoneyR05] = @LeaseAssureMoneyR05, [LeaseAssureMoneyR06] = @LeaseAssureMoneyR06, [LeaseAssureMoneyR07] = @LeaseAssureMoneyR07, [LeaseAssureMoneyR08] = @LeaseAssureMoneyR08, [LeaseAssureMoneyR09] = @LeaseAssureMoneyR09, [LeaseAssureMoneyR10] = @LeaseAssureMoneyR10, [LeaseAssureMoneyR11] = @LeaseAssureMoneyR11, [LeaseAssureMoneyR12] = @LeaseAssureMoneyR12, [LeaseDateFromR] = @LeaseDateFromR, [LeaseDateToR] = @LeaseDateToR, [TypeOfPaymentR01] = @TypeOfPaymentR01, [TypeOfPaymentR02] = @TypeOfPaymentR02, [TypeOfPaymentR03] = @TypeOfPaymentR03, [TypeOfPaymentR04] = @TypeOfPaymentR04, [TypeOfPaymentR05] = @TypeOfPaymentR05, [TypeOfPaymentR06] = @TypeOfPaymentR06, [TypeOfPaymentR07] = @TypeOfPaymentR07, [TypeOfPaymentR08] = @TypeOfPaymentR08, [TypeOfPaymentR09] = @TypeOfPaymentR09, [TypeOfPaymentR10] = @TypeOfPaymentR10, [TypeOfPaymentR11] = @TypeOfPaymentR11, [TypeOfPaymentR12] = @TypeOfPaymentR12, [FormerOweRentTotal] = @FormerOweRentTotal, [MonthRentR01] = @MonthRentR01, [MonthRentR02] = @MonthRentR02, [MonthRentR03] = @MonthRentR03, [MonthRentR04] = @MonthRentR04, [MonthRentR05] = @MonthRentR05, [MonthRentR06] = @MonthRentR06, [MonthRentR07] = @MonthRentR07, [MonthRentR08] = @MonthRentR08, [MonthRentR09] = @MonthRentR09, [MonthRentR10] = @MonthRentR10, [MonthRentR11] = @MonthRentR11, [MonthRentR12] = @MonthRentR12, [MonthRentPaid01] = @MonthRentPaid01, [MonthRentPaid02] = @MonthRentPaid02, [MonthRentPaid03] = @MonthRentPaid03, [MonthRentPaid04] = @MonthRentPaid04, [MonthRentPaid05] = @MonthRentPaid05, [MonthRentPaid06] = @MonthRentPaid06, [MonthRentPaid07] = @MonthRentPaid07, [MonthRentPaid08] = @MonthRentPaid08, [MonthRentPaid09] = @MonthRentPaid09, [MonthRentPaid10] = @MonthRentPaid10, [MonthRentPaid11] = @MonthRentPaid11, [MonthRentPaid12] = @MonthRentPaid12, [Income01] = @Income01, [Income02] = @Income02, [Income03] = @Income03, [Income04] = @Income04, [Income05] = @Income05, [Income06] = @Income06, [Income07] = @Income07, [Income08] = @Income08, [Income09] = @Income09, [Income10] = @Income10, [Income11] = @Income11, [Income12] = @Income12, [ContractRemarksR] = @ContractRemarksR, [ReceivableReMarks] = @ReceivableReMarks, [MonthRentRDate01] = @MonthRentRDate01, [MonthRentRDate02] = @MonthRentRDate02, [MonthRentRDate03] = @MonthRentRDate03, [MonthRentRDate04] = @MonthRentRDate04, [MonthRentRDate05] = @MonthRentRDate05, [MonthRentRDate06] = @MonthRentRDate06, [MonthRentRDate07] = @MonthRentRDate07, [MonthRentRDate08] = @MonthRentRDate08, [MonthRentRDate09] = @MonthRentRDate09, [MonthRentRDate10] = @MonthRentRDate10, [MonthRentRDate11] = @MonthRentRDate11, [MonthRentRDate12] = @MonthRentRDate12, [MonthRentPaidDate01] = @MonthRentPaidDate01, [MonthRentPaidDate12] = @MonthRentPaidDate12, [BelongToCompanyR] = @BelongToCompanyR WHERE [PRID] = @PRID">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="DropDownList_Month" Name="month" 
                                PropertyName="SelectedValue" />
                            <asp:ControlParameter ControlID="DropDownList_Year" DefaultValue="-1" 
                                Name="ReceivableID" PropertyName="SelectedValue" />
                            <asp:ControlParameter ControlID="DropDownList_BelongToCompanyR" 
                                Name="BelongToCompanyR" PropertyName="SelectedValue" />
                            <asp:ControlParameter ControlID="DropDownList_PropertyCityR" 
                                Name="PropertyCityR" PropertyName="SelectedValue" />
                            <asp:ControlParameter ControlID="DropDownList_PropertyRoadR" 
                                Name="PropertyRoadR" PropertyName="SelectedValue" />
                            <asp:ControlParameter ControlID="DropDownList_PropertyAddressR" 
                                Name="PropertyAddressR" PropertyName="SelectedValue" />
                            <asp:ControlParameter ControlID="TextBox_OppositeSideR" DefaultValue="-1" 
                                Name="OppositeSideR" PropertyName="Text" />
                        </SelectParameters>
                        <DeleteParameters>
                            <asp:Parameter Name="PRID" Type="Int32" />
                        </DeleteParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="ReceivableID" Type="Int32" />
                            <asp:Parameter Name="PropertyIDR" Type="Int32" />
                            <asp:Parameter Name="ContractNumberR" Type="String" />
                            <asp:Parameter Name="ManageProjectR" Type="String" />
                            <asp:Parameter Name="PropertyCityR" Type="String" />
                            <asp:Parameter Name="PropertyRoadR" Type="String" />
                            <asp:Parameter Name="PropertyAddressR" Type="String" />
                            <asp:Parameter Name="PropertyCRAR" Type="String" />
                            <asp:Parameter Name="OppositeSideR" Type="String" />
                            <asp:Parameter Name="LeaseAssureMoneyR01" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR02" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR03" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR04" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR05" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR06" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR07" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR08" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR09" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR10" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR11" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR12" Type="Int32" />
                            <asp:Parameter DbType="Date" Name="LeaseDateFromR" />
                            <asp:Parameter DbType="Date" Name="LeaseDateToR" />
                            <asp:Parameter Name="TypeOfPaymentR01" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR02" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR03" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR04" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR05" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR06" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR07" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR08" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR09" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR10" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR11" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR12" Type="String" />
                            <asp:Parameter Name="FormerOweRentTotal" Type="Int32" />
                            <asp:Parameter Name="MonthRentR01" Type="Int32" />
                            <asp:Parameter Name="MonthRentR02" Type="Int32" />
                            <asp:Parameter Name="MonthRentR03" Type="Int32" />
                            <asp:Parameter Name="MonthRentR04" Type="Int32" />
                            <asp:Parameter Name="MonthRentR05" Type="Int32" />
                            <asp:Parameter Name="MonthRentR06" Type="Int32" />
                            <asp:Parameter Name="MonthRentR07" Type="Int32" />
                            <asp:Parameter Name="MonthRentR08" Type="Int32" />
                            <asp:Parameter Name="MonthRentR09" Type="Int32" />
                            <asp:Parameter Name="MonthRentR10" Type="Int32" />
                            <asp:Parameter Name="MonthRentR11" Type="Int32" />
                            <asp:Parameter Name="MonthRentR12" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid01" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid02" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid03" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid04" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid05" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid06" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid07" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid08" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid09" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid10" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid11" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid12" Type="Int32" />
                            <asp:Parameter Name="Income01" Type="Int32" />
                            <asp:Parameter Name="Income02" Type="Int32" />
                            <asp:Parameter Name="Income03" Type="Int32" />
                            <asp:Parameter Name="Income04" Type="Int32" />
                            <asp:Parameter Name="Income05" Type="Int32" />
                            <asp:Parameter Name="Income06" Type="Int32" />
                            <asp:Parameter Name="Income07" Type="Int32" />
                            <asp:Parameter Name="Income08" Type="Int32" />
                            <asp:Parameter Name="Income09" Type="Int32" />
                            <asp:Parameter Name="Income10" Type="Int32" />
                            <asp:Parameter Name="Income11" Type="Int32" />
                            <asp:Parameter Name="Income12" Type="Int32" />
                            <asp:Parameter Name="ContractRemarksR" Type="String" />
                            <asp:Parameter Name="ReceivableReMarks" Type="String" />
                            <asp:Parameter Name="MonthRentRDate01" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate02" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate03" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate04" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate05" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate06" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate07" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate08" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate09" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate10" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate11" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate12" DbType="Date" />
                            <asp:Parameter DbType="Date" Name="MonthRentPaidDate01" />
                            <asp:Parameter DbType="Date" Name="MonthRentPaidDate12" />
                            <asp:Parameter Name="BelongToCompanyR" Type="String" />
                            <asp:Parameter Name="PRID" Type="Int32" />
                        </UpdateParameters>
                        <InsertParameters>
                            <asp:Parameter Name="ReceivableID" Type="Int32" />
                            <asp:Parameter Name="PropertyIDR" Type="Int32" />
                            <asp:Parameter Name="ContractNumberR" Type="String" />
                            <asp:Parameter Name="ManageProjectR" Type="String" />
                            <asp:Parameter Name="PropertyCityR" Type="String" />
                            <asp:Parameter Name="PropertyRoadR" Type="String" />
                            <asp:Parameter Name="PropertyAddressR" Type="String" />
                            <asp:Parameter Name="PropertyCRAR" Type="String" />
                            <asp:Parameter Name="OppositeSideR" Type="String" />
                            <asp:Parameter Name="LeaseAssureMoneyR01" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR02" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR03" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR04" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR05" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR06" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR07" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR08" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR09" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR10" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR11" Type="Int32" />
                            <asp:Parameter Name="LeaseAssureMoneyR12" Type="Int32" />
                            <asp:Parameter DbType="Date" Name="LeaseDateFromR" />
                            <asp:Parameter DbType="Date" Name="LeaseDateToR" />
                            <asp:Parameter Name="TypeOfPaymentR01" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR02" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR03" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR04" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR05" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR06" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR07" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR08" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR09" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR10" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR11" Type="String" />
                            <asp:Parameter Name="TypeOfPaymentR12" Type="String" />
                            <asp:Parameter Name="FormerOweRentTotal" Type="Int32" />
                            <asp:Parameter Name="MonthRentR01" Type="Int32" />
                            <asp:Parameter Name="MonthRentR02" Type="Int32" />
                            <asp:Parameter Name="MonthRentR03" Type="Int32" />
                            <asp:Parameter Name="MonthRentR04" Type="Int32" />
                            <asp:Parameter Name="MonthRentR05" Type="Int32" />
                            <asp:Parameter Name="MonthRentR06" Type="Int32" />
                            <asp:Parameter Name="MonthRentR07" Type="Int32" />
                            <asp:Parameter Name="MonthRentR08" Type="Int32" />
                            <asp:Parameter Name="MonthRentR09" Type="Int32" />
                            <asp:Parameter Name="MonthRentR10" Type="Int32" />
                            <asp:Parameter Name="MonthRentR11" Type="Int32" />
                            <asp:Parameter Name="MonthRentR12" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid01" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid02" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid03" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid04" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid05" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid06" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid07" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid08" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid09" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid10" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid11" Type="Int32" />
                            <asp:Parameter Name="MonthRentPaid12" Type="Int32" />
                            <asp:Parameter Name="Income01" Type="Int32" />
                            <asp:Parameter Name="Income02" Type="Int32" />
                            <asp:Parameter Name="Income03" Type="Int32" />
                            <asp:Parameter Name="Income04" Type="Int32" />
                            <asp:Parameter Name="Income05" Type="Int32" />
                            <asp:Parameter Name="Income06" Type="Int32" />
                            <asp:Parameter Name="Income07" Type="Int32" />
                            <asp:Parameter Name="Income08" Type="Int32" />
                            <asp:Parameter Name="Income09" Type="Int32" />
                            <asp:Parameter Name="Income10" Type="Int32" />
                            <asp:Parameter Name="Income11" Type="Int32" />
                            <asp:Parameter Name="Income12" Type="Int32" />
                            <asp:Parameter Name="ContractRemarksR" Type="String" />
                            <asp:Parameter Name="ReceivableReMarks" Type="String" />
                            <asp:Parameter Name="MonthRentRDate01" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate02" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate03" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate04" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate05" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate06" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate07" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate08" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate09" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate10" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate11" DbType="Date" />
                            <asp:Parameter Name="MonthRentRDate12" DbType="Date" />
                            <asp:Parameter DbType="Date" Name="MonthRentPaidDate01" />
                            <asp:Parameter DbType="Date" Name="MonthRentPaidDate12" />
                            <asp:Parameter Name="BelongToCompanyR" Type="String" />
                        </InsertParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="SqlDataSource_BelongToCompanyR" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:长铁物业公司资产数据库ConnectionString %>" 
                            SelectCommand="SELECT N'未选择' AS BelongToCompanyR UNION ALL SELECT DISTINCT BelongToCompanyR FROM ReceivableTable">
                        </asp:SqlDataSource>
                        <asp:SqlDataSource ID="SqlDataSource_PropertyCityR" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:长铁物业公司资产数据库ConnectionString %>" 
                            
                            SelectCommand="SELECT N'未选择' AS PropertyCityR UNION ALL SELECT DISTINCT PropertyCityR FROM ReceivableTable">
                        </asp:SqlDataSource>
                        <asp:SqlDataSource ID="SqlDataSource_PropertyRoadR" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:长铁物业公司资产数据库ConnectionString %>" 
                            
                            SelectCommand="SELECT N'未选择' AS PropertyRoadR UNION ALL SELECT DISTINCT PropertyRoadR FROM ReceivableTable WHERE (PropertyCityR = @PropertyCityR)">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="DropDownList_PropertyCityR" 
                                    Name="PropertyCityR" PropertyName="SelectedValue" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                        <asp:SqlDataSource ID="SqlDataSource_PropertyAddressR" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:长铁物业公司资产数据库ConnectionString %>" 
                            SelectCommand="SELECT N'未选择' AS PropertyAddressR UNION ALL SELECT DISTINCT PropertyAddressR FROM ReceivableTable WHERE (PropertyCityR = @PropertyCityR) AND (PropertyRoadR = @PropertyRoadR)">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="DropDownList_PropertyCityR" 
                                    Name="PropertyCityR" PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="DropDownList_PropertyRoadR" 
                                    Name="PropertyRoadR" PropertyName="SelectedValue" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
            </div>
    </body> 
    </html>
    
    </asp:Content>
    <asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    </asp:Content>
    


    C# 菜鸟中的雏鸟!提的问题也许很幼稚,但我是认真的。希望看在党国的面子上拉兄弟一把!

    2012年5月28日 4:52
  • ----------------------------后台代码1------------------------------

    using System;
    using System.Collections;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    using System.Data.SqlClient;
    
    public partial class ReceivableTable_Receivable6 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            CheckBoxList_All.Visible = false;
            Button_List.Visible = false;
            GridViewList();
        }
        protected void Button_Update_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < GridView_Search.Rows.Count; i++)
            {
                //增加了if判断,可以防止数据被清空
                GridViewRow row = GridView_Search.Rows[i];
    
                SqlDataSource_Search.UpdateParameters[0].DefaultValue = GridView_Search.DataKeys[i].Values[1].ToString();
                    SqlDataSource_Search.UpdateParameters[1].DefaultValue = GridView_Search.DataKeys[i].Values[2].ToString();
                if (CheckBoxList_All.Items[4].Selected == true)
                    { SqlDataSource_Search.UpdateParameters[2].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_ContractNumberR")).Text; }
                if (CheckBoxList_All.Items[5].Selected == true)
                    SqlDataSource_Search.UpdateParameters[3].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_ManageProjectR")).Text;
                if (CheckBoxList_All.Items[6].Selected == true)
                    SqlDataSource_Search.UpdateParameters[4].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_PropertyCityR")).Text;
                if (CheckBoxList_All.Items[7].Selected == true)
                    SqlDataSource_Search.UpdateParameters[5].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_PropertyRoadR")).Text;
                if (CheckBoxList_All.Items[8].Selected == true)
                    SqlDataSource_Search.UpdateParameters[6].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_PropertyAddressR")).Text;
                if (CheckBoxList_All.Items[9].Selected == true)
                    SqlDataSource_Search.UpdateParameters[7].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_PropertyCRAR")).Text;
                if (CheckBoxList_All.Items[10].Selected == true)
                    SqlDataSource_Search.UpdateParameters[8].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_OppositeSideR")).Text;
                if (CheckBoxList_All.Items[11].Selected == true)
                    SqlDataSource_Search.UpdateParameters[9].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_LeaseAssureMoneyR01")).Text;
                if (CheckBoxList_All.Items[12].Selected == true)
                    SqlDataSource_Search.UpdateParameters[10].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_LeaseAssureMoneyR02")).Text;
                if (CheckBoxList_All.Items[13].Selected == true)
                    SqlDataSource_Search.UpdateParameters[11].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_LeaseAssureMoneyR03")).Text;
                if (CheckBoxList_All.Items[14].Selected == true)
                    SqlDataSource_Search.UpdateParameters[12].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_LeaseAssureMoneyR04")).Text;
                if (CheckBoxList_All.Items[15].Selected == true)
                    SqlDataSource_Search.UpdateParameters[13].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_LeaseAssureMoneyR05")).Text;
                if (CheckBoxList_All.Items[16].Selected == true)
                    SqlDataSource_Search.UpdateParameters[14].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_LeaseAssureMoneyR06")).Text;
                if (CheckBoxList_All.Items[17].Selected == true)
                    SqlDataSource_Search.UpdateParameters[15].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_LeaseAssureMoneyR07")).Text;
                if (CheckBoxList_All.Items[18].Selected == true)
                    SqlDataSource_Search.UpdateParameters[16].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_LeaseAssureMoneyR08")).Text;
                if (CheckBoxList_All.Items[19].Selected == true)
                    SqlDataSource_Search.UpdateParameters[17].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_LeaseAssureMoneyR09")).Text;
                if (CheckBoxList_All.Items[20].Selected == true)
                    SqlDataSource_Search.UpdateParameters[18].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_LeaseAssureMoneyR10")).Text;
                if (CheckBoxList_All.Items[21].Selected == true)
                    SqlDataSource_Search.UpdateParameters[19].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_LeaseAssureMoneyR11")).Text;
                if (CheckBoxList_All.Items[22].Selected == true)
                    SqlDataSource_Search.UpdateParameters[20].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_LeaseAssureMoneyR12")).Text;
                if (CheckBoxList_All.Items[24].Selected == true)
                    SqlDataSource_Search.UpdateParameters[21].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_LeaseDateFromR")).Text;
                if (CheckBoxList_All.Items[25].Selected == true)
                    SqlDataSource_Search.UpdateParameters[22].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_LeaseDateToR")).Text;
                if (CheckBoxList_All.Items[26].Selected == true)
                    SqlDataSource_Search.UpdateParameters[23].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_TypeOfPaymentR01")).Text;
                if (CheckBoxList_All.Items[27].Selected == true)
                    SqlDataSource_Search.UpdateParameters[24].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_TypeOfPaymentR02")).Text;
                if (CheckBoxList_All.Items[28].Selected == true)
                    SqlDataSource_Search.UpdateParameters[25].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_TypeOfPaymentR03")).Text;
                if (CheckBoxList_All.Items[29].Selected == true)
                    SqlDataSource_Search.UpdateParameters[26].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_TypeOfPaymentR04")).Text;
                if (CheckBoxList_All.Items[30].Selected == true)
                    SqlDataSource_Search.UpdateParameters[27].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_TypeOfPaymentR05")).Text;
                if (CheckBoxList_All.Items[31].Selected == true)
                    SqlDataSource_Search.UpdateParameters[28].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_TypeOfPaymentR06")).Text;
                if (CheckBoxList_All.Items[32].Selected == true)
                    SqlDataSource_Search.UpdateParameters[29].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_TypeOfPaymentR07")).Text;
                if (CheckBoxList_All.Items[33].Selected == true)
                    SqlDataSource_Search.UpdateParameters[30].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_TypeOfPaymentR08")).Text;
                if (CheckBoxList_All.Items[34].Selected == true)
                    SqlDataSource_Search.UpdateParameters[31].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_TypeOfPaymentR09")).Text;
                if (CheckBoxList_All.Items[35].Selected == true)
                    SqlDataSource_Search.UpdateParameters[32].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_TypeOfPaymentR10")).Text;
                if (CheckBoxList_All.Items[36].Selected == true)
                    SqlDataSource_Search.UpdateParameters[33].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_TypeOfPaymentR11")).Text;
                if (CheckBoxList_All.Items[37].Selected == true)
                    SqlDataSource_Search.UpdateParameters[34].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_TypeOfPaymentR12")).Text;
                if (CheckBoxList_All.Items[39].Selected == true)
                    SqlDataSource_Search.UpdateParameters[35].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_FormerOweRentTotal")).Text;
                if (CheckBoxList_All.Items[40].Selected == true)
                    SqlDataSource_Search.UpdateParameters[36].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentR01")).Text;
                if (CheckBoxList_All.Items[41].Selected == true)
                    SqlDataSource_Search.UpdateParameters[37].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentR02")).Text;
                if (CheckBoxList_All.Items[42].Selected == true)
                    SqlDataSource_Search.UpdateParameters[38].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentR03")).Text;
                if (CheckBoxList_All.Items[43].Selected == true)
                    SqlDataSource_Search.UpdateParameters[39].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentR04")).Text;
                if (CheckBoxList_All.Items[44].Selected == true)
                    SqlDataSource_Search.UpdateParameters[40].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentR05")).Text;
                if (CheckBoxList_All.Items[45].Selected == true)
                    SqlDataSource_Search.UpdateParameters[41].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentR06")).Text;
                if (CheckBoxList_All.Items[46].Selected == true)
                    SqlDataSource_Search.UpdateParameters[42].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentR07")).Text;
                if (CheckBoxList_All.Items[47].Selected == true)
                    SqlDataSource_Search.UpdateParameters[43].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentR08")).Text;
                if (CheckBoxList_All.Items[48].Selected == true)
                    SqlDataSource_Search.UpdateParameters[44].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentR09")).Text;
                if (CheckBoxList_All.Items[49].Selected == true)
                    SqlDataSource_Search.UpdateParameters[45].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentR10")).Text;
                if (CheckBoxList_All.Items[50].Selected == true)
                    SqlDataSource_Search.UpdateParameters[46].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentR11")).Text;
                if (CheckBoxList_All.Items[51].Selected == true)
                    SqlDataSource_Search.UpdateParameters[47].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentR12")).Text;
                if (CheckBoxList_All.Items[52].Selected == true)
                    SqlDataSource_Search.UpdateParameters[48].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentPaid01")).Text;
                if (CheckBoxList_All.Items[53].Selected == true)
                    SqlDataSource_Search.UpdateParameters[49].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentPaid02")).Text;
                if (CheckBoxList_All.Items[54].Selected == true)
                    SqlDataSource_Search.UpdateParameters[50].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentPaid03")).Text;
                if (CheckBoxList_All.Items[55].Selected == true)
                    SqlDataSource_Search.UpdateParameters[51].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentPaid04")).Text;
                if (CheckBoxList_All.Items[56].Selected == true)
                    SqlDataSource_Search.UpdateParameters[52].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentPaid05")).Text;
                if (CheckBoxList_All.Items[57].Selected == true)
                    SqlDataSource_Search.UpdateParameters[53].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentPaid06")).Text;
                if (CheckBoxList_All.Items[58].Selected == true)
                    SqlDataSource_Search.UpdateParameters[54].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentPaid07")).Text;
                if (CheckBoxList_All.Items[59].Selected == true)
                    SqlDataSource_Search.UpdateParameters[55].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentPaid08")).Text;
                if (CheckBoxList_All.Items[60].Selected == true)
                    SqlDataSource_Search.UpdateParameters[56].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentPaid09")).Text;
                if (CheckBoxList_All.Items[61].Selected == true)
                    SqlDataSource_Search.UpdateParameters[57].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentPaid10")).Text;
                if (CheckBoxList_All.Items[62].Selected == true)
                    SqlDataSource_Search.UpdateParameters[58].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentPaid11")).Text;
                if (CheckBoxList_All.Items[63].Selected == true)
                    SqlDataSource_Search.UpdateParameters[59].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentPaid12")).Text;
                if (CheckBoxList_All.Items[71].Selected == true)
                    SqlDataSource_Search.UpdateParameters[60].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_Income01")).Text;
                if (CheckBoxList_All.Items[72].Selected == true)
                    SqlDataSource_Search.UpdateParameters[61].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_Income02")).Text;
                if (CheckBoxList_All.Items[73].Selected == true)
                    SqlDataSource_Search.UpdateParameters[62].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_Income03")).Text;
                if (CheckBoxList_All.Items[74].Selected == true)
                    SqlDataSource_Search.UpdateParameters[63].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_Income04")).Text;
                if (CheckBoxList_All.Items[75].Selected == true)
                    SqlDataSource_Search.UpdateParameters[64].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_Income05")).Text;
                if (CheckBoxList_All.Items[76].Selected == true)
                    SqlDataSource_Search.UpdateParameters[65].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_Income06")).Text;
                if (CheckBoxList_All.Items[77].Selected == true)
                    SqlDataSource_Search.UpdateParameters[66].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_Income07")).Text;
                if (CheckBoxList_All.Items[78].Selected == true)
                    SqlDataSource_Search.UpdateParameters[67].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_Income08")).Text;
                if (CheckBoxList_All.Items[79].Selected == true)
                    SqlDataSource_Search.UpdateParameters[68].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_Income09")).Text;
                if (CheckBoxList_All.Items[80].Selected == true)
                    SqlDataSource_Search.UpdateParameters[69].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_Income10")).Text;
                if (CheckBoxList_All.Items[81].Selected == true)
                    SqlDataSource_Search.UpdateParameters[70].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_Income11")).Text;
                if (CheckBoxList_All.Items[82].Selected == true)
                    SqlDataSource_Search.UpdateParameters[71].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_Income12")).Text;
                if (CheckBoxList_All.Items[84].Selected == true)
                    SqlDataSource_Search.UpdateParameters[72].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_ContractRemarksR")).Text;
                if (CheckBoxList_All.Items[85].Selected == true)
                    SqlDataSource_Search.UpdateParameters[73].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_ReceivableReMarks")).Text;
                if (CheckBoxList_All.Items[86].Selected == true)
                    SqlDataSource_Search.UpdateParameters[74].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentRDate01")).Text;
                if (CheckBoxList_All.Items[87].Selected == true)
                    SqlDataSource_Search.UpdateParameters[75].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentRDate02")).Text;
                if (CheckBoxList_All.Items[88].Selected == true)
                    SqlDataSource_Search.UpdateParameters[76].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentRDate03")).Text;
                if (CheckBoxList_All.Items[89].Selected == true)
                    SqlDataSource_Search.UpdateParameters[77].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentRDate04")).Text;
                if (CheckBoxList_All.Items[90].Selected == true)
                    SqlDataSource_Search.UpdateParameters[78].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentRDate05")).Text;
                if (CheckBoxList_All.Items[91].Selected == true)
                    SqlDataSource_Search.UpdateParameters[79].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentRDate06")).Text;
                if (CheckBoxList_All.Items[92].Selected == true)
                    SqlDataSource_Search.UpdateParameters[80].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentRDate07")).Text;
                if (CheckBoxList_All.Items[93].Selected == true)
                    SqlDataSource_Search.UpdateParameters[81].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentRDate08")).Text;
                if (CheckBoxList_All.Items[94].Selected == true)
                    SqlDataSource_Search.UpdateParameters[82].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentRDate09")).Text;
                if (CheckBoxList_All.Items[95].Selected == true)
                    SqlDataSource_Search.UpdateParameters[83].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentRDate10")).Text;
                if (CheckBoxList_All.Items[96].Selected == true)
                    SqlDataSource_Search.UpdateParameters[84].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentRDate11")).Text;
                if (CheckBoxList_All.Items[97].Selected == true)
                    SqlDataSource_Search.UpdateParameters[85].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentRDate12")).Text;
                if (CheckBoxList_All.Items[98].Selected == true)
                    SqlDataSource_Search.UpdateParameters[86].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentPaidDate01")).Text;
                if (CheckBoxList_All.Items[99].Selected == true)
                    SqlDataSource_Search.UpdateParameters[87].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_MonthRentPaidDate12")).Text;
                if (CheckBoxList_All.Items[100].Selected == true)
                    SqlDataSource_Search.UpdateParameters[88].DefaultValue = ((TextBox)row.Cells[0].FindControl("TextBox_BelongToCompanyR")).Text;
                //第1、2行有DataKeys[]的其他两个列
                SqlDataSource_Search.UpdateParameters[89].DefaultValue = GridView_Search.DataKeys[i].Values[0].ToString();
                SqlDataSource_Search.Update();
    
            }
        }
        //各月押金及指定月押金
        int TotalLeaseAssureMoneyR01 = 0;
        int TotalLeaseAssureMoneyR02 = 0;
        int TotalLeaseAssureMoneyR03 = 0;
        int TotalLeaseAssureMoneyR04 = 0;
        int TotalLeaseAssureMoneyR05 = 0;
        int TotalLeaseAssureMoneyR06 = 0;
        int TotalLeaseAssureMoneyR07 = 0;
        int TotalLeaseAssureMoneyR08 = 0;
        int TotalLeaseAssureMoneyR09 = 0;
        int TotalLeaseAssureMoneyR10 = 0;
        int TotalLeaseAssureMoneyR11 = 0;
        int TotalLeaseAssureMoneyR12 = 0;
        int TotalExpr1 = 0;
        
        int TotalFormerOweRentTotal = 0;
        //各月合同应收
        int TotalMonthRentR01 = 0;
        int TotalMonthRentR02 = 0;
        int TotalMonthRentR03 = 0;
        int TotalMonthRentR04 = 0;
        int TotalMonthRentR05 = 0;
        int TotalMonthRentR06 = 0;
        int TotalMonthRentR07 = 0;
        int TotalMonthRentR08 = 0;
        int TotalMonthRentR09 = 0;
        int TotalMonthRentR10 = 0;
        int TotalMonthRentR11 = 0;
        int TotalMonthRentR12 = 0;
        int TotalMonthRentPaid01 = 0;
        int TotalMonthRentPaid02 = 0;
        int TotalMonthRentPaid03 = 0;
        int TotalMonthRentPaid04 = 0;
        int TotalMonthRentPaid05 = 0;
        int TotalMonthRentPaid06 = 0;
        int TotalMonthRentPaid07 = 0;
        int TotalMonthRentPaid08 = 0;
        int TotalMonthRentPaid09 = 0;
        int TotalMonthRentPaid10 = 0;
        int TotalMonthRentPaid11 = 0;
        int TotalMonthRentPaid12 = 0;
        //
        int TotalExpr3 = 0;
        int TotalExpr4 = 0;
        int TotalExpr5 = 0;
        int TotalExpr6 = 0;
        int TotalExpr7 = 0;
        //
        int TotalIncome01 = 0;
        int TotalIncome02 = 0;
        int TotalIncome03 = 0;
        int TotalIncome04 = 0;
        int TotalIncome05 = 0;
        int TotalIncome06 = 0;
        int TotalIncome07 = 0;
        int TotalIncome08 = 0;
        int TotalIncome09 = 0;
        int TotalIncome10 = 0;
        int TotalIncome11 = 0;
        int TotalIncome12 = 0;
        int TotalExpr8 = 0;
        int TotalExpr9 = 0;
        int TotalExpr10 = 0;
    
    
        protected void GridView_Search_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            //LeaseAssureMoneyR
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "LeaseAssureMoneyR01").ToString(), out temp);
                TotalLeaseAssureMoneyR01 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[11].Text += TotalLeaseAssureMoneyR01.ToString();
                e.Row.Cells[11].HorizontalAlign = HorizontalAlign.Left;
            }
    
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "LeaseAssureMoneyR02").ToString(), out temp);
                TotalLeaseAssureMoneyR02 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[12].Text += TotalLeaseAssureMoneyR02.ToString();
                e.Row.Cells[12].HorizontalAlign = HorizontalAlign.Left;
            }
    
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "LeaseAssureMoneyR03").ToString(), out temp);
                TotalLeaseAssureMoneyR03 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[13].Text += TotalLeaseAssureMoneyR03.ToString();
                e.Row.Cells[13].HorizontalAlign = HorizontalAlign.Left;
            }
    
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "LeaseAssureMoneyR04").ToString(), out temp);
                TotalLeaseAssureMoneyR04 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[14].Text += TotalLeaseAssureMoneyR04.ToString();
                e.Row.Cells[14].HorizontalAlign = HorizontalAlign.Left;
            }
    
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "LeaseAssureMoneyR05").ToString(), out temp);
                TotalLeaseAssureMoneyR05 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[15].Text += TotalLeaseAssureMoneyR05.ToString();
                e.Row.Cells[15].HorizontalAlign = HorizontalAlign.Left;
            }
    
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "LeaseAssureMoneyR06").ToString(), out temp);
                TotalLeaseAssureMoneyR06 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[16].Text += TotalLeaseAssureMoneyR06.ToString();
                e.Row.Cells[16].HorizontalAlign = HorizontalAlign.Left;
            }
    
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "LeaseAssureMoneyR07").ToString(), out temp);
                TotalLeaseAssureMoneyR07 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[17].Text += TotalLeaseAssureMoneyR07.ToString();
                e.Row.Cells[17].HorizontalAlign = HorizontalAlign.Left;
            }
    
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "LeaseAssureMoneyR08").ToString(), out temp);
                TotalLeaseAssureMoneyR08 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[18].Text += TotalLeaseAssureMoneyR08.ToString();
                e.Row.Cells[18].HorizontalAlign = HorizontalAlign.Left;
            }
    
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "LeaseAssureMoneyR09").ToString(), out temp);
                TotalLeaseAssureMoneyR09 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[19].Text += TotalLeaseAssureMoneyR09.ToString();
                e.Row.Cells[19].HorizontalAlign = HorizontalAlign.Left;
            }
    
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "LeaseAssureMoneyR10").ToString(), out temp);
                TotalLeaseAssureMoneyR10 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[20].Text += TotalLeaseAssureMoneyR10.ToString();
                e.Row.Cells[20].HorizontalAlign = HorizontalAlign.Left;
            }
    
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "LeaseAssureMoneyR11").ToString(), out temp);
                TotalLeaseAssureMoneyR11 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[21].Text += TotalLeaseAssureMoneyR11.ToString();
                e.Row.Cells[21].HorizontalAlign = HorizontalAlign.Left;
            }
    
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "LeaseAssureMoneyR12").ToString(), out temp);
                TotalLeaseAssureMoneyR12 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[22].Text += TotalLeaseAssureMoneyR12.ToString();
                e.Row.Cells[22].HorizontalAlign = HorizontalAlign.Left;
            }
    
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Expr1").ToString(), out temp);
                TotalExpr1 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[23].Text += TotalExpr1.ToString();
                e.Row.Cells[23].HorizontalAlign = HorizontalAlign.Left;
            }
    
            //FormerOweRentTotal
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "FormerOweRentTotal").ToString(), out temp);
                TotalFormerOweRentTotal += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[39].Text += TotalFormerOweRentTotal.ToString();
                e.Row.Cells[39].HorizontalAlign = HorizontalAlign.Left;
            }
    
        //    //MonthRentR
        //    if (e.Row.RowType == DataControlRowType.DataRow)
        //    {
        //        int temp = 0;
        //        int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentR").ToString(), out temp);
        //        TotalMonthRentR += temp;
        //    }
        //    else if (e.Row.RowType == DataControlRowType.Footer)
        //    {
        //        e.Row.Cells[14].Text += TotalMonthRentR.ToString();
        //        e.Row.Cells[14].HorizontalAlign = HorizontalAlign.Left;
        //    }
    
    
    
            //MonthRentR01
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentR01").ToString(), out temp);
                TotalMonthRentR01 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[40].Text += TotalMonthRentR01.ToString();
                e.Row.Cells[40].HorizontalAlign = HorizontalAlign.Left;
            }
    
            //MonthRentR02
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentR02").ToString(), out temp);
                TotalMonthRentR02 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[41].Text += TotalMonthRentR02.ToString();
                e.Row.Cells[41].HorizontalAlign = HorizontalAlign.Left;
            }
    
            //MonthRentR03
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentR03").ToString(), out temp);
                TotalMonthRentR03 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[42].Text += TotalMonthRentR03.ToString();
                e.Row.Cells[42].HorizontalAlign = HorizontalAlign.Left;
            }
    
            //MonthRentR04
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentR04").ToString(), out temp);
                TotalMonthRentR04 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[43].Text += TotalMonthRentR04.ToString();
                e.Row.Cells[43].HorizontalAlign = HorizontalAlign.Left;
            }
    
            //MonthRentR05
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentR05").ToString(), out temp);
                TotalMonthRentR05 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[44].Text += TotalMonthRentR05.ToString();
                e.Row.Cells[44].HorizontalAlign = HorizontalAlign.Left;
            }
    
            //MonthRentR06
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentR06").ToString(), out temp);
                TotalMonthRentR06 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[45].Text += TotalMonthRentR06.ToString();
                e.Row.Cells[45].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentR07
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentR07").ToString(), out temp);
                TotalMonthRentR07 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[46].Text += TotalMonthRentR07.ToString();
                e.Row.Cells[46].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentR08
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentR08").ToString(), out temp);
                TotalMonthRentR08 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[47].Text += TotalMonthRentR08.ToString();
                e.Row.Cells[47].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentR09
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentR09").ToString(), out temp);
                TotalMonthRentR09 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[48].Text += TotalMonthRentR09.ToString();
                e.Row.Cells[48].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentR10
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentR10").ToString(), out temp);
                TotalMonthRentR10 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[49].Text += TotalMonthRentR10.ToString();
                e.Row.Cells[49].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentR11
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentR11").ToString(), out temp);
                TotalMonthRentR11 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[50].Text += TotalMonthRentR11.ToString();
                e.Row.Cells[50].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentR12
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentR12").ToString(), out temp);
                TotalMonthRentR12 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[51].Text += TotalMonthRentR12.ToString();
                e.Row.Cells[51].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentPaid01
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentPaid01").ToString(), out temp);
                TotalMonthRentPaid01 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[52].Text += TotalMonthRentPaid01.ToString();
                e.Row.Cells[52].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentPaid02
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentPaid02").ToString(), out temp);
                TotalMonthRentPaid02 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[53].Text += TotalMonthRentPaid02.ToString();
                e.Row.Cells[53].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentPaid03
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentPaid03").ToString(), out temp);
                TotalMonthRentPaid03 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[54].Text += TotalMonthRentPaid03.ToString();
                e.Row.Cells[54].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentPaid04
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentPaid04").ToString(), out temp);
                TotalMonthRentPaid04 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[55].Text += TotalMonthRentPaid04.ToString();
                e.Row.Cells[55].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentPaid05
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentPaid05").ToString(), out temp);
                TotalMonthRentPaid05 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[56].Text += TotalMonthRentPaid05.ToString();
                e.Row.Cells[56].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentPaid06
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentPaid06").ToString(), out temp);
                TotalMonthRentPaid06 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[57].Text += TotalMonthRentPaid06.ToString();
                e.Row.Cells[57].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentPaid07
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentPaid07").ToString(), out temp);
                TotalMonthRentPaid07 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[58].Text += TotalMonthRentPaid07.ToString();
                e.Row.Cells[58].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentPaid08
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentPaid08").ToString(), out temp);
                TotalMonthRentPaid08 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[59].Text += TotalMonthRentPaid08.ToString();
                e.Row.Cells[59].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentPaid09
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentPaid09").ToString(), out temp);
                TotalMonthRentPaid09 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[60].Text += TotalMonthRentPaid09.ToString();
                e.Row.Cells[60].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentPaid10
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentPaid10").ToString(), out temp);
                TotalMonthRentPaid10 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[61].Text += TotalMonthRentPaid10.ToString();
                e.Row.Cells[61].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentPaid11
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentPaid11").ToString(), out temp);
                TotalMonthRentPaid11 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[62].Text += TotalMonthRentPaid11.ToString();
                e.Row.Cells[62].HorizontalAlign = HorizontalAlign.Left;
            }
            //MonthRentPaid12
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "MonthRentPaid12").ToString(), out temp);
                TotalMonthRentPaid12 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[63].Text += TotalMonthRentPaid12.ToString();
                e.Row.Cells[63].HorizontalAlign = HorizontalAlign.Left;
            }
            //五个表达式:上月欠收、本月合同应收、本月总应收、本月实收、本月欠收
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Expr3").ToString(), out temp);
                TotalExpr3 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[64].Text += TotalExpr3.ToString();
                e.Row.Cells[64].HorizontalAlign = HorizontalAlign.Left;
            }
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Expr4").ToString(), out temp);
                TotalExpr4 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[65].Text += TotalExpr4.ToString();
                e.Row.Cells[65].HorizontalAlign = HorizontalAlign.Left;
            }
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Expr5").ToString(), out temp);
                TotalExpr5 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[66].Text += TotalExpr5.ToString();
                e.Row.Cells[66].HorizontalAlign = HorizontalAlign.Left;
            }
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Expr6").ToString(), out temp);
                TotalExpr6 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[67].Text += TotalExpr6.ToString();
                e.Row.Cells[67].HorizontalAlign = HorizontalAlign.Left;
            }
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Expr7").ToString(), out temp);
                TotalExpr7 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[68].Text += TotalExpr7.ToString();
                e.Row.Cells[68].HorizontalAlign = HorizontalAlign.Left;
            }
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Expr8").ToString(), out temp);
                TotalExpr8 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[69].Text += TotalExpr8.ToString();
                e.Row.Cells[69].HorizontalAlign = HorizontalAlign.Left;
            }
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Expr9").ToString(), out temp);
                TotalExpr9 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[70].Text += TotalExpr9.ToString();
                e.Row.Cells[70].HorizontalAlign = HorizontalAlign.Left;
            }
       
            //收入Income
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Income01").ToString(), out temp);
                TotalIncome01 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[71].Text += TotalIncome01.ToString();
                e.Row.Cells[71].HorizontalAlign = HorizontalAlign.Left;
            } if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Income02").ToString(), out temp);
                TotalIncome02 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[72].Text += TotalIncome02.ToString();
                e.Row.Cells[72].HorizontalAlign = HorizontalAlign.Left;
            } 
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Income03").ToString(), out temp);
                TotalIncome03 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[73].Text += TotalIncome03.ToString();
                e.Row.Cells[73].HorizontalAlign = HorizontalAlign.Left;
            } 
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Income04").ToString(), out temp);
                TotalIncome04 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[74].Text += TotalIncome04.ToString();
                e.Row.Cells[74].HorizontalAlign = HorizontalAlign.Left;
            } 
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Income05").ToString(), out temp);
                TotalIncome05 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[75].Text += TotalIncome05.ToString();
                e.Row.Cells[75].HorizontalAlign = HorizontalAlign.Left;
            } 
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Income06").ToString(), out temp);
                TotalIncome06 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[76].Text += TotalIncome06.ToString();
                e.Row.Cells[76].HorizontalAlign = HorizontalAlign.Left;
            } 
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Income07").ToString(), out temp);
                TotalIncome07 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[77].Text += TotalIncome07.ToString();
                e.Row.Cells[77].HorizontalAlign = HorizontalAlign.Left;
            } 
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Income08").ToString(), out temp);
                TotalIncome08 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[78].Text += TotalIncome08.ToString();
                e.Row.Cells[78].HorizontalAlign = HorizontalAlign.Left;
            } 
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Income09").ToString(), out temp);
                TotalIncome09 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[79].Text += TotalIncome09.ToString();
                e.Row.Cells[79].HorizontalAlign = HorizontalAlign.Left;
            } 
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Income10").ToString(), out temp);
                TotalIncome10 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[80].Text += TotalIncome10.ToString();
                e.Row.Cells[80].HorizontalAlign = HorizontalAlign.Left;
            } 
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Income11").ToString(), out temp);
                TotalIncome11 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[81].Text += TotalIncome11.ToString();
                e.Row.Cells[81].HorizontalAlign = HorizontalAlign.Left;
            } 
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Income12").ToString(), out temp);
                TotalIncome12 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[82].Text += TotalIncome12.ToString();
                e.Row.Cells[82].HorizontalAlign = HorizontalAlign.Left;
            }
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int temp = 0;
                int.TryParse(DataBinder.Eval(e.Row.DataItem, "Expr10").ToString(), out temp);
                TotalExpr10 += temp;
            }
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[83].Text += TotalExpr10.ToString();
                e.Row.Cells[83].HorizontalAlign = HorizontalAlign.Left;
            }
            
    
        }
        protected void Button_List_Click(object sender, EventArgs e)
        {
            GridViewList();
            CheckBoxList_All.Visible = false;
            Button_List.Visible = false;
            RadioButton_No.Checked = true;
            RadioButton_Yes.Checked = false;
        }
    
        protected void GridViewList()
        {
            for (int i = 0; i < CheckBoxList_All.Items.Count; i++)
            {
                if (CheckBoxList_All.Items[i].Selected == true)
                {
                    
                    GridView_Search.Columns[i].Visible = true;
                }
                else
                { GridView_Search.Columns[i].Visible = false; }
            }
    
        }
        protected void RadioButton_Yes_CheckedChanged(object sender, EventArgs e)
        {
            if (RadioButton_Yes.Checked == true)
            {
                CheckBoxList_All.Visible = true;
                Button_List.Visible = true;
            }
            else
            {
                CheckBoxList_All.Visible = false;
                Button_List.Visible = false;
            }
        }
        protected void RadioButton_No_CheckedChanged(object sender, EventArgs e)
        {
            if (RadioButton_No.Checked == true)
            {
                CheckBoxList_All.Visible = false;
                Button_List.Visible = false;
            }
            else
            {
                CheckBoxList_All.Visible = true;
                Button_List.Visible = true;
            }
        }
    }
    


    C# 菜鸟中的雏鸟!提的问题也许很幼稚,但我是认真的。希望看在党国的面子上拉兄弟一把!

    2012年5月28日 4:54
  • ------------------------------SQL表----------------------

    USE [长铁物业公司资产数据库]
    GO
    
    /****** Object:  Table [dbo].[ReceivableTable]    Script Date: 05/28/2012 10:15:32 ******/
    SET ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    CREATE TABLE [dbo].[ReceivableTable](
    	[ReceivableID] [int] NULL,
    	[PropertyIDR] [int] NULL,
    	[PRID] [int] IDENTITY(1,1) NOT NULL,
    	[ContractNumberR] [nvarchar](30) NULL,
    	[ManageProjectR] [nvarchar](30) NULL,
    	[PropertyCityR] [nvarchar](20) NULL,
    	[PropertyRoadR] [nvarchar](20) NULL,
    	[PropertyAddressR] [nvarchar](255) NULL,
    	[PropertyCRAR] [nvarchar](255) NULL,
    	[OppositeSideR] [nvarchar](30) NULL,
    	[LeaseAssureMoneyR01] [int] NULL,
    	[LeaseAssureMoneyR02] [int] NULL,
    	[LeaseAssureMoneyR03] [int] NULL,
    	[LeaseAssureMoneyR04] [int] NULL,
    	[LeaseAssureMoneyR05] [int] NULL,
    	[LeaseAssureMoneyR06] [int] NULL,
    	[LeaseAssureMoneyR07] [int] NULL,
    	[LeaseAssureMoneyR08] [int] NULL,
    	[LeaseAssureMoneyR09] [int] NULL,
    	[LeaseAssureMoneyR10] [int] NULL,
    	[LeaseAssureMoneyR11] [int] NULL,
    	[LeaseAssureMoneyR12] [int] NULL,
    	[LeaseDateFromR] [date] NULL,
    	[LeaseDateToR] [date] NULL,
    	[TypeOfPaymentR01] [nvarchar](30) NULL,
    	[TypeOfPaymentR02] [nvarchar](30) NULL,
    	[TypeOfPaymentR03] [nvarchar](30) NULL,
    	[TypeOfPaymentR04] [nvarchar](30) NULL,
    	[TypeOfPaymentR05] [nvarchar](30) NULL,
    	[TypeOfPaymentR06] [nvarchar](30) NULL,
    	[TypeOfPaymentR07] [nvarchar](30) NULL,
    	[TypeOfPaymentR08] [nvarchar](30) NULL,
    	[TypeOfPaymentR09] [nvarchar](30) NULL,
    	[TypeOfPaymentR10] [nvarchar](30) NULL,
    	[TypeOfPaymentR11] [nvarchar](30) NULL,
    	[TypeOfPaymentR12] [nvarchar](30) NULL,
    	[FormerOweRentTotal] [int] NULL,
    	[MonthRentR01] [int] NULL,
    	[MonthRentR02] [int] NULL,
    	[MonthRentR03] [int] NULL,
    	[MonthRentR04] [int] NULL,
    	[MonthRentR05] [int] NULL,
    	[MonthRentR06] [int] NULL,
    	[MonthRentR07] [int] NULL,
    	[MonthRentR08] [int] NULL,
    	[MonthRentR09] [int] NULL,
    	[MonthRentR10] [int] NULL,
    	[MonthRentR11] [int] NULL,
    	[MonthRentR12] [int] NULL,
    	[MonthRentPaid01] [int] NULL,
    	[MonthRentPaid02] [int] NULL,
    	[MonthRentPaid03] [int] NULL,
    	[MonthRentPaid04] [int] NULL,
    	[MonthRentPaid05] [int] NULL,
    	[MonthRentPaid06] [int] NULL,
    	[MonthRentPaid07] [int] NULL,
    	[MonthRentPaid08] [int] NULL,
    	[MonthRentPaid09] [int] NULL,
    	[MonthRentPaid10] [int] NULL,
    	[MonthRentPaid11] [int] NULL,
    	[MonthRentPaid12] [int] NULL,
    	[Income01] [int] NULL,
    	[Income02] [int] NULL,
    	[Income03] [int] NULL,
    	[Income04] [int] NULL,
    	[Income05] [int] NULL,
    	[Income06] [int] NULL,
    	[Income07] [int] NULL,
    	[Income08] [int] NULL,
    	[Income09] [int] NULL,
    	[Income10] [int] NULL,
    	[Income11] [int] NULL,
    	[Income12] [int] NULL,
    	[ContractRemarksR] [nvarchar](255) NULL,
    	[ReceivableReMarks] [nvarchar](255) NULL,
    	[MonthRentRDate01] [date] NULL,
    	[MonthRentRDate02] [date] NULL,
    	[MonthRentRDate03] [date] NULL,
    	[MonthRentRDate04] [date] NULL,
    	[MonthRentRDate05] [date] NULL,
    	[MonthRentRDate06] [date] NULL,
    	[MonthRentRDate07] [date] NULL,
    	[MonthRentRDate08] [date] NULL,
    	[MonthRentRDate09] [date] NULL,
    	[MonthRentRDate10] [date] NULL,
    	[MonthRentRDate11] [date] NULL,
    	[MonthRentRDate12] [date] NULL,
    	[MonthRentPaidDate01] [date] NULL,
    	[MonthRentPaidDate12] [date] NULL,
    	[BelongToCompanyR] [nvarchar](10) NULL,
     CONSTRAINT [PK_ReceivableTable] PRIMARY KEY CLUSTERED 
    (
    	[PRID] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    
    GO
    
    


    C# 菜鸟中的雏鸟!提的问题也许很幼稚,但我是认真的。希望看在党国的面子上拉兄弟一把!

    2012年5月28日 4:56
  • 想彻底改变的话估计你或许要使用一些数据库表设计原理的知识,重新设计表了,否则你的表字段那么多……很难说不影响速度的。

       QQ我:讨论(Talk)
    下载MSDN桌面工具(Vista,Win7)
    我的博客园
    慈善点击,点击此处

    2012年5月28日 5:00
  • 这个表是按照数据库范式定律来做的,可是 “列” 确实有这么多。。。

    C# 菜鸟中的雏鸟!提的问题也许很幼稚,但我是认真的。希望看在党国的面子上拉兄弟一把!

    2012年5月28日 5:33
  • 这个表是按照数据库范式定律来做的,可是 “列” 确实有这么多。。。

    C# 菜鸟中的雏鸟!提的问题也许很幼稚,但我是认真的。希望看在党国的面子上拉兄弟一把!

    那么你就应该有选择地把某些不需要显示的列不显示,动态改变SQL选择语句。

       QQ我:讨论(Talk)
    下载MSDN桌面工具(Vista,Win7)
    我的博客园
    慈善点击,点击此处

    2012年5月28日 5:37
  • 我现在采取的方式是显示所有列,然后利用DropDownList来显示所需要显示的列。我明白您所说的“动态改变SQL选择语句”的意思,但是我是用SQLDataSource做的数据源,再用GridView选择该数据源。我不知道该如何“动态改变SQL”,能否具体提示一下呢?

    C# 菜鸟中的雏鸟!提的问题也许很幼稚,但我是认真的。希望看在党国的面子上拉兄弟一把!

    2012年5月28日 5:54
  • 我现在采取的方式是显示所有列,然后利用DropDownList来显示所需要显示的列。我明白您所说的“动态改变SQL选择语句”的意思,但是我是用SQLDataSource做的数据源,再用GridView选择该数据源。我不知道该如何“动态改变SQL”,能否具体提示一下呢?

    C# 菜鸟中的雏鸟!提的问题也许很幼稚,但我是认真的。希望看在党国的面子上拉兄弟一把!

    如果有可能的话,建议你:

    1)舍去SqlDataSource改用纯的SqlDataAdapter+DataTable,直接绑定到GridView。

    2)可以循环判断CheckBox或者已经选中的列名,组合成完整的SQL选择语句,然后使用SqlDataAdapter.Fill(DataTable)中,绑定到GridView。


       QQ我:讨论(Talk)
    下载MSDN桌面工具(Vista,Win7)
    我的博客园
    慈善点击,点击此处

    2012年5月28日 5:58
  • 那我不是要全部重新做过了 啊!   好痛苦。。。

    C# 菜鸟中的雏鸟!提的问题也许很幼稚,但我是认真的。希望看在党国的面子上拉兄弟一把!

    2012年5月28日 9:18
  • 那我不是要全部重新做过了 啊!   好痛苦。。。

    C# 菜鸟中的雏鸟!提的问题也许很幼稚,但我是认真的。希望看在党国的面子上拉兄弟一把!

    不需要重新做吧...你看看哪里慢就改哪里

    如果真需要重做...

    我建议可以看点orm方面的知识...用nh entityframework linq to sql 之类的框架来写..这样代码易于维护.而且简单..几乎可以实现0 sql


    2012年5月28日 13:00
    版主
  • 打开20行速度还不错,但要是打开120行就很慢了!

    我要怎么样才知道是哪里  慢 了呢?


    C# 菜鸟中的雏鸟!提的问题也许很幼稚,但我是认真的。希望看在党国的面子上拉兄弟一把!

    2012年5月29日 0:31
  • 你采取了分页吗?

    每页显示20行...这样就OK了!

    2012年5月29日 0:52
    版主
  • 打开20行速度还不错,但要是打开120行就很慢了!

    我要怎么样才知道是哪里  慢 了呢?


    C# 菜鸟中的雏鸟!提的问题也许很幼稚,但我是认真的。希望看在党国的面子上拉兄弟一把!

    你到底是列多还是行多?看样子貌似行多啊!应该分页……

       QQ我:讨论(Talk)
    下载MSDN桌面工具(Vista,Win7)
    我的博客园
    慈善点击,点击此处

    2012年5月29日 1:02
  •     是列多,有100个列,也就是每个资产有100个列的相关信息。我有450个资产,全部显示出来就是100*450个格子了,太多了!所以我设置了DropDownList来选择需要显示的列。我又不太想使用分页的功能,所以想找到一个在代码里优化的方法!

        分页功能确实有效,但这是退而求其次的选择。。。


    C# 菜鸟中的雏鸟!提的问题也许很幼稚,但我是认真的。希望看在党国的面子上拉兄弟一把!

    2012年5月29日 6:52
  • 我还是建议您是否可以把不需要的列不要显示,动态拼接SQL显示需要的列,那么多列同时显示……唉……

       QQ我:讨论(Talk)
    下载MSDN桌面工具(Vista,Win7)
    我的博客园
    慈善点击,点击此处

    2012年5月29日 8:34
  • 如果确实是列太多..那用脚本隐藏列也很慢的..因为数据库还是要读取那么多数据...你可以 编程志愿者 的方法...试试 看看能不能改善!
    2012年5月29日 15:35
    版主
  • 动态的拼接SQL,这个我试过!但是还没试过联合DropDownList控件使用。如果我利用DropDownList,应该还要写个循环比较方便吧?还没想出来这种循环该怎么写。。。

    C# 菜鸟中的雏鸟!提的问题也许很幼稚,但我是认真的。希望看在党国的面子上拉兄弟一把!

    2012年5月30日 0:41
  • 主要是列字段太多,而且用了GRIDVIEW的GridView_Search_RowDataBound事件,绑定时,又要循环一遍

    首先想办法减少输出的列,不显示的就不要输出了,用动态SQL试试吧

    为了设计方便,前台可以用SELECT * 的 SELECTCOMMAND

    在后台中再动态改变SELECTCOMMAND

    2012年5月30日 1:56