<%@ Import Namespace="System.Data" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm2.aspx.vb" Inherits="WebApplication99.WebForm2"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm2</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<asp:DataList id="parentRepeater" runat="server" RepeatDirection="Horizontal" RepeatColumns="2"
Width="560px">
<ItemTemplate>
<b>
<%# Container.DataItem("str") %>
</b>
<br>
<asp:Repeater id="childRepeater9" runat="server" datasource='<%# Container.DataItem.Row.GetChildRows("myrelation") %>'>
<itemtemplate>
<%# Container.DataItem("str") %>
</itemtemplate>
</asp:Repeater>
<p></p>
</ItemTemplate>
</asp:DataList>
</form>
</body>
</HTML>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm2.aspx.vb" Inherits="WebApplication99.WebForm2"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm2</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<asp:DataList id="parentRepeater" runat="server" RepeatDirection="Horizontal" RepeatColumns="2"
Width="560px">
<ItemTemplate>
<b>
<%# Container.DataItem("str") %>
</b>
<br>
<asp:Repeater id="childRepeater9" runat="server" datasource='<%# Container.DataItem.Row.GetChildRows("myrelation") %>'>
<itemtemplate>
<%# Container.DataItem("str") %>
</itemtemplate>
</asp:Repeater>
<p></p>
</ItemTemplate>
</asp:DataList>
</form>
</body>
</HTML>
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cnn As SqlConnection = New SqlConnection(sqlIO.conn.ToString)
Dim cmd1 As SqlDataAdapter = New SqlDataAdapter("select * from tab", cnn)
Dim ds As DataSet = New DataSet
cmd1.Fill(ds, "tab")
Dim cmd2 As SqlDataAdapter = New SqlDataAdapter("select * from tab2", cnn)
cmd2.Fill(ds, "tab2")
ds.Relations.Add("myrelation", _
ds.Tables("tab").Columns("id"), _
ds.Tables("tab2").Columns("id1"))
parentRepeater.DataSource = ds.Tables("tab")
parentRepeater.DataSource = ds.Tables("tab")
Page.DataBind()
cnn.Close()
End Sub
Dim cnn As SqlConnection = New SqlConnection(sqlIO.conn.ToString)
Dim cmd1 As SqlDataAdapter = New SqlDataAdapter("select * from tab", cnn)
Dim ds As DataSet = New DataSet
cmd1.Fill(ds, "tab")
Dim cmd2 As SqlDataAdapter = New SqlDataAdapter("select * from tab2", cnn)
cmd2.Fill(ds, "tab2")
ds.Relations.Add("myrelation", _
ds.Tables("tab").Columns("id"), _
ds.Tables("tab2").Columns("id1"))
parentRepeater.DataSource = ds.Tables("tab")
parentRepeater.DataSource = ds.Tables("tab")
Page.DataBind()
cnn.Close()
End Sub