当前位置:编程学习 > C#/ASP.NET >>

谁可以告诉我Repeater为什么控件不显示

代码编译后没有错误,但是不显示Repeater数据
.cs代码如下
  protected void Page_Load(object sender, EventArgs e)
    {
        Page.DataBind();
        string n = Request.QueryString["m"];
        string s = Request.QueryString["y"];

        Response.Write(n);
        string myConnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|/jixiao.mdb;user ID=Admin;Password=;";


        OleDbDataAdapter myCommand = new OleDbDataAdapter("select * from rw where rw_name='n'", myConnString);

        DataSet ds = new DataSet();
        myCommand.Fill(ds, "绩效");
        rw.DataSource = ds.Tables["绩效"].DefaultView;
        rw.DataBind(); 

}


html代码如下
<asp:Repeater ID=rw runat=server EnableViewState=true>
 <ItemTemplate>
        <table align="center" border="1" bordercolor="#333366" width="890" >
        
 
            <tr>
                <td style="width: 112px; height: 34px">
<asp:TextBox ID="check_fen" runat=server Width="80px" text='<%#DataBinder.Eval(Container.DataItem, "rw_check") %>' OnDataBinding="Page_Load"></asp:TextBox></td>


  <td colspan="4" style="height: 34px; text-align: center; width: 282px;">
                    <asp:TextBox ID="ck_content" runat="server" Width="450px" text='<%# DataBinder.Eval(Container.DataItem, "check_content") %>' OnDataBinding="Page_Load"></asp:TextBox></td>

                <td style="width: 103px; height: 34px; text-align: center">
                    <asp:TextBox ID="TextBox_a" runat="server" Width="30px" text='<%# DataBinder.Eval(Container.DataItem, "rw_a") %>' OnDataBinding="Page_Load"></asp:TextBox></td>

                <td style="width: 110px; height: 34px; text-align: center">
                    <asp:TextBox ID="TextBox_b" runat="server" Width="30px" text='<%# DataBinder.Eval(Container.DataItem, "rw_b ") %>'  OnDataBinding="Page_Load"></asp:TextBox></td>

                <td style="width: 100px; height: 34px; text-align: center">
                    <asp:TextBox ID="TextBox_c" runat="server" Width="30px" text='<%# DataBinder.Eval(Container.DataItem, "rw_c") %>' OnDataBinding="Page_Load"></asp:TextBox></td>

                <td style="width: 100px; height: 34px; text-align: center">
                    <asp:TextBox ID="TextBox_d" runat="server" Width="30px" text='<%# DataBinder.Eval(Container.DataItem, "rw_d") %>' OnDataBinding="Page_Load"></asp:TextBox></td>
            </tr>


          
        </table>
     </ItemTemplate>
 </asp:Repeater>

--------------------编程问答-------------------- 没有人回啊
--------------------编程问答-------------------- 没分啊. --------------------编程问答-------------------- 可能是数据源里没数据的缘故! --------------------编程问答-------------------- 解决了马上给分 --------------------编程问答-------------------- 现在换了个sql语句报错"myCommand.Fill(ds, "绩效");"有个异常

if (!IsPostBack)
        {
            string n = Request.QueryString["m"];
            string s = Request.QueryString["y"];

            Response.Write(n);
            string myConnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|/jixiao.mdb;user ID=Admin;Password=;";


            OleDbDataAdapter myCommand = new OleDbDataAdapter("select * from rw where rw_name='" + n + "'", myConnString);

            DataSet ds = new DataSet();
            myCommand.Fill(ds, "绩效");
            rw.DataSource = ds.Tables["绩效"].DefaultView;
            rw.DataBind();

        } --------------------编程问答-------------------- up
--------------------编程问答-------------------- 估计是连不上数据库. --------------------编程问答-------------------- 肯定是连接上了,老是错误在 myCommand.Fill(ds, "绩效");这个地方 --------------------编程问答-------------------- 无数据吧 --------------------编程问答-------------------- 提示是myCommand.Fill(ds, "绩效");这句里有什么无限循环的. --------------------编程问答-------------------- 未处理的“System.StackOverflowException”类型的异常出现在 System.Data.dll 中。
这个错误
--------------------编程问答-------------------- 怎么没打开连接呢? --------------------编程问答-------------------- 这个不需要打开连接的,打开了也是这样的. --------------------编程问答-------------------- up --------------------编程问答-------------------- 不要用“绩效”的中文看看,程序没错,要么换句简单的sql语句试试,可能读到空数据 --------------------编程问答-------------------- 没有数据,就不显示repeater
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,