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

推荐订阅源

博客园 - 聂微东
GbyAI
GbyAI
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 叶小钗
A
About on SuperTechFans
M
MIT News - Artificial intelligence
宝玉的分享
宝玉的分享
雷峰网
雷峰网
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Martin Fowler
Martin Fowler
Google DeepMind News
Google DeepMind News
博客园 - Franky
B
Blog RSS Feed
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
MongoDB | Blog
MongoDB | Blog
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research

博客园 - aaron.net

个人门户系统制作完成,欢迎测试~~ C#和VB 在动态添加用户控件时, 不一样啊。。。 - aaron.net 哈哈哈哈 微软也出错。。。。。。 用用户控件模仿datalist mediaplayer object 代码 - aaron.net AJAX 学习 ,,自己做了个计算器 ExecuteScalar 用SQL统计记录数 - aaron.net - 博客园 用SQL统计记录数 - aaron.net - 博客园 在网页中传递汉字的方法 - aaron.net - 博客园 class Property Get、Property Let 使用说明 制作网页时的23个经典代码 从魔兽中的英雄设计机制来窥探面向对象的思想 存储过程 满屏显示。。。。常用HTML代码 Visual Studio 2005 Express Beta Products(Full Package) Download 控件有时需要声明,有时不需要声明的原因! web控件介绍(asp.net快速入门) ASP.NET设计七大绝招 超链接 css
datalist,repeater,datagrid嵌套问题,,解决代码,,总结
aaron.net · 2005-03-13 · via 博客园 - aaron.net

   后台
        if e.CommandName = "select" then

            DataList1.SelectedIndex = e.Item.ItemIndex
            Dim objConn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath(".") & "/db1.mdb")
           
            Dim objAdapter1 As New OleDbDataAdapter("select * from guestbook", objConn)
            Dim objAdapter2 As New OleDbDataAdapter("select * from message", objConn)
            Dim ds As New DataSet
            objAdapter1.fill(ds, "guestbook")
            objAdapter2.fill(ds, "message")
            ds.Relations.Add("myrelations", ds.Tables("guestbook").Columns("id"), ds.Tables("message").Columns("id_reply"),False)
            
            DataList1.DataSource = ds.Tables("guestbook").DefaultView
            DataList1.EditItemIndex = -1
            DataList1.DataBind()
         

          end if


子datalist

<asp:datalist id=datalist1   Runat=Server DataSource='<%# Ctype(Container.DataItem,DataRowView).CreateChildView("myrelations") %>'
                          <itemtemplate>
                          <%#DataBinder.Eval(Container.DataItem, "id_reply")%>
                          <%#DataBinder.Eval(Container.DataItem, "title")%>
                          </itemtemplate>

                          </asp:datalist>

注意问题:

id  和id_reply的值必须相等,,,而且id和id_reply的数据类型必须相同,如必须全是数字型