惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Martin Fowler
Martin Fowler
GbyAI
GbyAI
P
Palo Alto Networks Blog
N
Netflix TechBlog - Medium
C
Cisco Blogs
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
A
About on SuperTechFans
PCI Perspectives
PCI Perspectives
Scott Helme
Scott Helme
TaoSecurity Blog
TaoSecurity Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
K
Kaspersky official blog
W
WeLiveSecurity
Y
Y Combinator Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
有赞技术团队
有赞技术团队
人人都是产品经理
人人都是产品经理
月光博客
月光博客
N
News | PayPal Newsroom
Microsoft Azure Blog
Microsoft Azure Blog
G
GRAHAM CLULEY
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
MongoDB | Blog
MongoDB | Blog
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Know Your Adversary
Know Your Adversary
博客园 - Franky
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
F
Full Disclosure
V
Vulnerabilities – Threatpost
V
Visual Studio Blog
Forbes - Security
Forbes - Security
Attack and Defense Labs
Attack and Defense Labs
MyScale Blog
MyScale Blog
Hacker News: Ask HN
Hacker News: Ask HN
T
Tor Project blog

博客园 - "鸟巢"

SQL2008安装指南 合并两个DataSet Asp.Net学习资源 VS常用快捷键 SQL Server 2005 Full-Text Index 入门 VS2003基础知识一 如何管好下属(转载) VS2003中DataBinder.Eval用法范例 - "鸟巢" - 博客园 数据的增删改 传统行业与网络相结合 CSS中position的理解 Windows Internet服务器安全配置 服务器入侵工具 Ajax 'Sys'未定义错误 转载 .NET工程师求职面试必杀技 分页存储过程 项目管理九大知识体系: 项目负债人手册 中文变问号问题
学习VS2005杂记
"鸟巢" · 2008-02-25 · via 博客园 - "鸟巢"

aspx代码:
  <div>
        <asp:Repeater ID="Repeater1" runat="server">
         <ItemTemplate>
            <div><a href="#"><%# Eval("loginfo")%></a></div><br />            
         </ItemTemplate>
        </asp:Repeater>                   
    </div>
cs代码:
using System.Data.SqlClient;

            SqlConnection conn = new SqlConnection();
            conn.ConnectionString = "Server=(local);DataBase=Codematic;User ID=sa;Password=";
            string strSql = "SELECT * FROM S_LOG";
            SqlCommand cmd = new SqlCommand(strSql);
            cmd.CommandText = strSql;
            SqlDataAdapter da = new SqlDataAdapter();
            DataSet ds = new DataSet();
            cmd.Connection = conn;
            da.SelectCommand = cmd;
            conn.Open();                      
            da.Fill(ds);
            conn.Close();
            this.Repeater1.DataSource = ds.Tables[0].DefaultView;
            this.Repeater1.DataBind();

与2003的不同之处是控件绑定的格式更加简化了:
<%# Eval("loginfo")%>
VS2003的格式:

<asp:TemplateColumn HeaderText="电话">
          <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
          <ItemStyle HorizontalAlign="Center" Width="13%"></ItemStyle>
          <ItemTemplate>
           <%# DataBinder.Eval(Container.DataItem, "TEL") %>
          </ItemTemplate>
         </asp:TemplateColumn>

posted @ 2008-02-25 17:46  "鸟巢"  阅读(166)  评论()    收藏  举报