zoukankan      html  css  js  c++  java
  • asp.net查询数据显示在网页上的方法

    1.创建<asp:SqlDataSource></asp:SqlDataSource>

    然后配置数据库的连接方式

    2.数据绑定 <asp:Repeater></asp:Repeater>

    下面是源码

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString='<%$ ConnectionStrings:zhangyuxiangConnectionString %>' SelectCommand="SELECT * FROM [ehr_EMP]"></asp:SqlDataSource>
    <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
    <HeaderTemplate>
    <table>
    <tr>
    <td>用户编号</td>
    <td>合同起始时间</td>
    </tr>
    </table>
    </HeaderTemplate>
    <ItemTemplate>
    <table style="border:2px solid black">
    <tr>
    <td style="border:2px solid red ;200px;"><%#DataBinder.Eval(Container.DataItem,"PersId") %></td>
    <td style="border:2px solid red ;200px;"><%#DataBinder.Eval(Container.DataItem,"Worktime") %></td>
    </tr>
    </table>
    </ItemTemplate>

    </asp:Repeater>

    页面展示

  • 相关阅读:
    book pile SGU
    Inversions SGU
    蒟蒻LQL的博客
    控制台注入DLL代码
    Windows消息类型
    windows编程中的数据类型
    单链表的创建与遍历
    定义函数指针
    启动外部程序
    dll共享段中一些需要注意的问题
  • 原文地址:https://www.cnblogs.com/bellwether/p/15636907.html
Copyright © 2011-2022 走看看