zoukankan      html  css  js  c++  java
  • Repeater控件绑定SqlDataReader数据源

    C#源码

    string SqlConString = "Data Source=(local);Initial Catalog=FTPData;Integrated Security=True";
    SqlConnection con = new SqlConnection(SqlConString);
    con.Open();
    SqlCommand cmd = new SqlCommand(CreateSQLQueryString(), con);
    SqlDataReader dr = cmd.ExecuteReader();
    RepeaterResult.DataSource = dr;
    RepeaterResult.DataBind();
    dr.Close();
    con.Close(); 

    aspx文件中

    <asp:Repeater ID="RepeaterResult" runat="server" onitemdatabound="RepeaterResult_ItemDataBound">
        <HeaderTemplate>
            <table>
        </HeaderTemplate>
        <ItemTemplate>
            <tr><td width="100%" colspan="2"><a class="result_filename"><%#HilghtKeyWord(Eval("Filename").ToString())%></a></td></tr>
            <tr><td width="150">文件类型:<a class="result_postfix"><%#Eval("Postfix")%></a></td>
           <
    td>大小:<a class="result_size"><%#Eval("size") %></a>KB</td></tr> <tr><td width="100%" colspan="2">来源:<a class="result_lai"><%#GetPath(Eval("FileID").ToString())%></a></td></tr> <tr><td>&nbsp;</td></tr> </ItemTemplate> <FooterTemplate>    </table> </FooterTemplate> </asp:Repeater>
  • 相关阅读:
    16-1-6 kafka的操作
    16-1-5:MapReduce
    MapReduce概述
    MapReduce的代码实现过程分析
    MapReduce
    HDFS2—SequenceFile(小文件的解决方案)
    HDFS2—federation
    hdfs
    缓解爬虫ip被封的概率
    zookeeper集群搭建
  • 原文地址:https://www.cnblogs.com/lijingpeng/p/2476302.html
Copyright © 2011-2022 走看看