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

推荐订阅源

I
Intezer
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
H
Heimdal Security Blog
I
InfoQ
Blog — PlanetScale
Blog — PlanetScale
Apple Machine Learning Research
Apple Machine Learning Research
Spread Privacy
Spread Privacy
腾讯CDC
大猫的无限游戏
大猫的无限游戏
Recent Announcements
Recent Announcements
V
Vulnerabilities – Threatpost
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
Google Developers Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
J
Java Code Geeks
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
V
Visual Studio Blog
Microsoft Azure Blog
Microsoft Azure Blog
Google Online Security Blog
Google Online Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
W
WeLiveSecurity
宝玉的分享
宝玉的分享
aimingoo的专栏
aimingoo的专栏
博客园_首页
S
Security @ Cisco Blogs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Recent Commits to openclaw:main
Recent Commits to openclaw:main
P
Privacy International News Feed
H
Hacker News: Front Page
Vercel News
Vercel News
T
Troy Hunt's Blog
Forbes - Security
Forbes - Security
N
News and Events Feed by Topic
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
U
Unit 42
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
B
Blog RSS Feed
T
Threat Research - Cisco Blogs
C
Cyber Attacks, Cyber Crime and Cyber Security
Schneier on Security
Schneier on Security
Last Week in AI
Last Week in AI
H
Help Net Security
M
MIT News - Artificial intelligence
美团技术团队

博客园 - "鸟巢"

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)  评论()    收藏  举报