c#网格视图不显示结果

时间:2016-05-17 12:11:20

标签: c# asp.net aspxgridview

在aspx站点中,我从数据库获取数据并将其放入数据源,然后网格视图使用该数据源来显示数据。由于某种原因,它适用于“facharztgruppen”网格视图,但不适用于其他视图。我不知道我做了什么不同。

这是我的代码:

C#

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="rx_check.aspx.cs" Inherits="Cockpit_RVI.rx_check" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div align="center">
        ...
    </div>
    <hr />
    <div align="center">

        <asp:Label ID="lbl_facharztgruppen" runat="server" style="font-weight: 700; font-size: x-large" Text="Facharztgruppen"></asp:Label>
        <br />
        <br />
        <asp:GridView ID="gv_facharztgruppen" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" ForeColor="Black" GridLines="Vertical">
            <AlternatingRowStyle BackColor="#CCCCCC" />
            <Columns>
                <asp:BoundField DataField="fg" HeaderText="FGID" NullDisplayText="-" />
                <asp:BoundField DataField="fachgruppe_name" HeaderText="Fachgruppe" NullDisplayText="-" />
                <asp:BoundField DataField="anzahl" HeaderText="Anzahl der  Rezepte akt. Monat" NullDisplayText="-" />
                <asp:BoundField DataField="b_anzahl" HeaderText="Anzahl Rezepte Vormonat" NullDisplayText="-" />
                <asp:BoundField DataField="c_anzahl" HeaderText="Anzahl Rezepte Durchschnitt" NullDisplayText="-" />
                <asp:BoundField DataField="aktuell" HeaderText="Dummy C Akt. Monat" NullDisplayText="-" />
                <asp:BoundField DataField="vormonat" HeaderText="Dummy C Vormonat" NullDisplayText="-" />
                <asp:BoundField DataField="mittelwert" HeaderText="Dummy C Mittelwert" NullDisplayText="-" />
            </Columns>
            <FooterStyle BackColor="#CCCCCC" />
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="Gray" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
        <asp:SqlDataSource ID="ds_facharztgruppen" runat="server" ConnectionString="<%$ ConnectionStrings:ORADB_VAL %>" ProviderName="<%$ ConnectionStrings:ORADB_VAL.ProviderName %>" SelectCommand="select 1 from dual"></asp:SqlDataSource>
        <asp:Label ID="Label1" runat="server" ForeColor="Red" style="font-weight: 700" Text="not done" Visible="False"></asp:Label>
        <br />
        <asp:Button ID="btnup_facharztgruppen" runat="server" Text="↑" Width="80px" />
        <br />
        <br />

        <br />
        <br />
        <asp:Label ID="lbl_liefergebiete" runat="server" style="font-weight: 700; font-size: x-large" Text="Liefergebiete"></asp:Label>
        <br />
        <br />
        <asp:GridView ID="gv_liefergebiete" runat="server" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" ForeColor="Black" GridLines="Vertical" AutoGenerateColumns="False" OnSelectedIndexChanged="gv_liefergebiete_SelectedIndexChanged">
            <AlternatingRowStyle BackColor="#CCCCCC" />
            <Columns>
                <asp:BoundField DataField="KV" HeaderText="KV-Region" />
                <asp:BoundField DataField="ANZAHL" HeaderText="Anteil Rezepte akt. Monat" />
                <asp:BoundField DataField="B_ANZAHL" HeaderText="Anteil Rezepte Vormonat" />
                <asp:BoundField DataField="C_ANZAHL" HeaderText="Anteil Rezepte Durchschnitt" />
            </Columns>
            <FooterStyle BackColor="#CCCCCC" />
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
        <asp:SqlDataSource ID="ds_liefergebiete" runat="server" ConnectionString="<%$ ConnectionStrings:ORADB_VAL %>" ProviderName="<%$ ConnectionStrings:ORADB_VAL.ProviderName %>" SelectCommand="select 1 from dual
"></asp:SqlDataSource>
        <br />
        <asp:Button ID="btnup_liefergebiete" runat="server" Text="↑" Width="80px" />
        <br />
        <br />

        <br />
        <br />
        <asp:Label ID="lbl_verschreibungsgebiete" runat="server" style="font-weight: 700; font-size: x-large" Text="Verschreibungsgebiete"></asp:Label>
        <br />
        <br />
        <asp:GridView ID="gv_verschreibungsgebiete" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" ForeColor="Black" GridLines="Vertical">
            <AlternatingRowStyle BackColor="#CCCCCC" />
            <Columns>
                <asp:BoundField DataField="kv" HeaderText="KV-Region" />
                <asp:BoundField DataField="anzahl" HeaderText="Anteil Rezepte akt. Monat" />
                <asp:BoundField DataField="b_anzahl" HeaderText="Anteil Rezepte Vormonat" />
                <asp:BoundField DataField="c_anzahl" HeaderText="Anteil Rezepte Durchschnitt" />
            </Columns>
            <FooterStyle BackColor="#CCCCCC" />
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="Gray" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
        <asp:SqlDataSource ID="ds_verschreibungsgebiete" runat="server" ConnectionString="<%$ ConnectionStrings:ORADB_VAL %>" ProviderName="<%$ ConnectionStrings:ORADB_VAL.ProviderName %>" SelectCommand="select 1 from dual"></asp:SqlDataSource>
        <br />
        <asp:Button ID="btnup_verschreibungsgebiete" runat="server" Text="↑" Width="80px" />

    </div>
    </form>
</body>
</html>

site.aspx

{{1}}

0 个答案:

没有答案