GetChildRows()返回的是记录集,不能做数据源,应该用CreateChildView()
解决方案 »
- 在一台加入域的2003上发布asp.net站点出现拒绝访问的问题
- 哥,姐,帮个忙
- 刚出道的程序员上哪找工作
- 怎样可以使TABLE正确显示多个空格?
- [分享]免费下载ASP.NET 网络程序员指南
- 在一个HTML文件中,如何分页显示文章的内容
- 在asp.net mvc框架下,如何使用dropdownlist来实现两级联动
- 在一个不是页面的类中如何调用Request、Application和Session??
- 操作WORD文档,出现“内存不足,请现在保存文档。”错误
- 请问如何分批地进行数据绑定
- 请问!为什么不能添加用户控件?
- 在样在Global中作数据库连接,在样在其他页面中引用此连接对象,在线等
??
如此?
谢谢,请稍微再加指点
<%@ Page Language="vb" Debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %><script language="VB" runat="server">
dim MyConnection as OleDbConnection
dim cmdSelect as OleDbCommand
dim dtrReader as OleDbDataReader
Sub Page_load(sender as object,e as Eventargs)
MyConnection = New OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=c:\inetpub\wwwroot\datagrid\kk.mdb")
if not IsPostBack() then
Mydatagrid_DataBind()
end if
End SubSub Mydatagrid_DataBind()
Dim MyCommand As OleDbDataAdapter = new OleDbDataAdapter("select * from [class]", MyConnection)
Dim DS As DataSet = new DataSet()
MyCommand.Fill(DS,"board")
BigClassList.DataSource=DS.Tables("board").DefaultView
BigClassList.DataBind()
End SubFunction SmallClass(BigClassID) as DataTable
dim SmallClassData as DataSet =new DataSet()
MyConnection.Open()
dim DataAdapter as OleDbDataAdapter = new OleDbDataAdapter("SELECT * FROM [board] WHERE class="& BigClassID &"",MyConnection)
DataAdapter.Fill(SmallClassData,"SmallClassData")
MyConnection.Close()
return SmallClassData.Tables("SmallClassData")
End Function</script>
<html>
<head>
<title>NHONLINE_BBS_INDEX</title>
<link rel="stylesheet" href="css.css" type="text/css">
</head>
<body><form Runat="server">
<asp:Repeater id="BigClassList" runat="server">
<ItemTemplate>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor="#797979" BgColor="#CACACA" cellSpacing="0" cellPadding="4" width="700" height="30" align="center" border="1">
<TR>
<TD height="35" align="left"><B> <FONT COLOR="#CC0000"><%#Container.DataItem("class")%></FONT></B>
</TD>
</TR>
</TABLE>
<!-- ---------------------------------------------------------- -->
<TABLE style="BORDER-COLLAPSE: collapse" borderColor="#797979" BgColor="#F9F9F9" cellSpacing="0" cellPadding="4" width="700" align="center" border="1">
<asp:Repeater id="SmallClassList" runat="server" DataSource='<%# SmallClass(Container.DataItem("id").ToString()) %>'>
<ItemTemplate>
<TR>
<TD valign="top">
<TABLE style="BORDER-COLLAPSE: collapse" borderColor="#797979" BgColor="#F9F9F9" cellSpacing="0" cellPadding="4" width="650" align="center" border="0">
<TR>
<TD width="250"><FONT COLOR="#330099">
¡y <A HREF='<%#"List_5_5.aspx?BoardID="& Container.DataItem("boardid")%>'><%#Container.DataItem("boardtype")%></A> ¡z</FONT>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</ItemTemplate>
</asp:Repeater>
</TABLE>
</ItemTemplate>
</asp:Repeater>
</form>
</body>
</html>