| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1045 人关注过本帖
标题:Repeater不显示
只看楼主 加入收藏
swalia
Rank: 1
等 级:新手上路
帖 子:108
专家分:0
注 册:2006-4-16
收藏
 问题点数:0 回复次数:4 
Repeater不显示
<asp:Repeater ID="Repeater1" runat="server">
                  <HeaderTemplate>
                  <table width="540" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="C96C82">
  <tr align="center" bgcolor="EED3D9">
    <td width="71" height="27"><font color="A90771"><b>乘机人</b></font></td>
    <td width="112" height="27"><font color="A90771"><b>订单号</b></font></td>
    <td width="85" height="27"><font color="A90771"><b>航程</b></font></td>
    <td width="49" height="27"><font color="A90771"><b>航班号</b></font></td>
    <td width="70" height="27"><font color="A90771"><b>起飞日期</b></font></td>
    <td width="70" height="27"><font color="A90771"><b>预订日期</b></font></td>
    <td width="61" height="27"><font color="A90771"><b>订单状态</b></font></td>
  </tr>
  </HeaderTemplate>
                <ItemTemplate>
  <tr align="center" bgcolor="EBF3FB">
    <td height="26"><asp:Repeater ID="childRepeater" runat="server" DataSource='<%# ((DataRowView)Container.DataItem).Row.GetChildRows("Userid") %>'>
    <ItemTemplate><%# DataBinder.Eval(Container.DataItem,"[\"Name\"]") %><br /></ItemTemplate></asp:Repeater></td>
    <td height="26"><a href="OrderModify.aspx?Orderid=<%#DataBinder.Eval(Container.DataItem,"OrderID")  %>"><Font color="blue"><%# DataBinder.Eval(Container.DataItem,"OrderID") %></Font></a></td>
    <td height="26"><%# DataBinder.Eval(Container.DataItem, "BeginCity")%> → <%#DataBinder.Eval(Container.DataItem, "EndCity")%></td>
    <td height="26"><%# DataBinder.Eval(Container.DataItem,"FlightNo") %></td>
    <td height="26"><%# DataBinder.Eval(Container.DataItem,"BeginDate","{0:d}")%></td>
    <td height="26"><%# DataBinder.Eval(Container.DataItem,"OrderTime","{0:MM-dd HH:mm}" )%></td>
    <td height="26"><img src='<%# DataBinder.Eval(Container.DataItem,"Status","IMGS/{0}.gif")%>' /></td>
  </tr>
  </ItemTemplate>
                <FooterTemplate>
</table>
</FooterTemplate>
                  </asp:Repeater>
CS代码
  strcon.Open();
         SqlDataAdapter da = new SqlDataAdapter("select* from FlightOrder where Userid='" + Session["Userid"].ToString() + "' and OrderTime> '" + DateTime.Today.AddDays(-14) + "'", strcon);
         da.Fill(ds1, "FlightOrder");
        
            SqlDataAdapter dat = new SqlDataAdapter("select* from FlightOrderDetail order by ID desc", strcon);
            dat.Fill(ds1, "FlightOrderDetail");
        
         try
         {  
            ds1.Relations.Add("Userid", ds1.Tables["FlightOrder"].Columns["OrderID"], ds1.Tables["FlightOrderDetail"].Columns["OrderID"]);
            this.Repeater1.DataSource = ds1;
            this.Repeater1.DataBind();
            if (this.Repeater1.Items.Count == 0)
            {
                this.Panel1.Visible = true;
                this.Panel2.Visible = false;
                this.Labmessage.Text = "您近两周内没有新订单,请您在订单查询中查找您的以前订单(本系统只保留60天订单)";
            }
            else
            {
                this.Panel1.Visible = false;
                this.Panel2.Visible = true;
            }
         }
         catch (Exception ex)
         {
            //throw ex;
         }
         finally
         {
为什么表里面的Userid两个数据不同时就不显示??
搜索更多相关主题的帖子: Repeater font height bgcolor 
2008-05-01 11:52
beniao
Rank: 2
等 级:新手上路
威 望:4
帖 子:367
专家分:2
注 册:2004-12-17
收藏
得分:0 
不能满足条件他当然是不会显示出数据的.

博客:http://
2008-05-01 16:40
swalia
Rank: 1
等 级:新手上路
帖 子:108
专家分:0
注 册:2006-4-16
收藏
得分:0 
那要怎么改?????
2008-05-01 16:46
beniao
Rank: 2
等 级:新手上路
威 望:4
帖 子:367
专家分:2
注 册:2004-12-17
收藏
得分:0 
回复 3# 的帖子
做程序前可以使用
GridView测试下是否查询到数据

博客:http://
2008-05-01 17:05
swalia
Rank: 1
等 级:新手上路
帖 子:108
专家分:0
注 册:2006-4-16
收藏
得分:0 
但是我用户名一样的就可显示啊???
2008-05-02 14:21
快速回复:Repeater不显示
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015192 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved