<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %><html>
<script language="VB" runat="server"> Sub Page_Load(Sender As Object, E As EventArgs) Dim DS As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter MyConnection = New SqlConnection("server=(local)\NetSDK;database=pubs;Trusted_Connection=yes")
MyCommand = New SqlDataAdapter("select * from Titles", MyConnection) DS = New DataSet()
MyCommand.Fill(DS, "书名") MyRepeater.DataSource = DS.Tables("书名").DefaultView
MyRepeater.DataBind()
End Sub</script><body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"> <!-- #include virtual="/quickstart/aspplus/samples/webforms/customize/header.inc" --> <ASP:Repeater id="MyRepeater" runat="server"> <HeaderTemplate> <table width="100%" style="font: 9pt 宋体">
<tr style="background-color:DFA894">
<th>
书名
</th>
<th>
书名 ID
</th>
<th>
类型
</th>
<th>
出版商 ID
</th>
<th>
价格
</th>
</tr> </HeaderTemplate> <ItemTemplate> <tr style="background-color:FFECD8">
<td>
<%# DataBinder.Eval(Container.DataItem, "title") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "title_id") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "type") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "pub_id") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "price", "$ {0}") %>
</td>
</tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </ASP:Repeater> <!-- #include virtual="/quickstart/aspplus/samples/webforms/customize/footer.inc" --></body>
</html>
<%@ Import Namespace="System.Data.SqlClient" %><html>
<script language="VB" runat="server"> Sub Page_Load(Sender As Object, E As EventArgs) Dim DS As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter MyConnection = New SqlConnection("server=(local)\NetSDK;database=pubs;Trusted_Connection=yes")
MyCommand = New SqlDataAdapter("select * from Titles", MyConnection) DS = New DataSet()
MyCommand.Fill(DS, "书名") MyRepeater.DataSource = DS.Tables("书名").DefaultView
MyRepeater.DataBind()
End Sub</script><body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"> <!-- #include virtual="/quickstart/aspplus/samples/webforms/customize/header.inc" --> <ASP:Repeater id="MyRepeater" runat="server"> <HeaderTemplate> <table width="100%" style="font: 9pt 宋体">
<tr style="background-color:DFA894">
<th>
书名
</th>
<th>
书名 ID
</th>
<th>
类型
</th>
<th>
出版商 ID
</th>
<th>
价格
</th>
</tr> </HeaderTemplate> <ItemTemplate> <tr style="background-color:FFECD8">
<td>
<%# DataBinder.Eval(Container.DataItem, "title") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "title_id") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "type") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "pub_id") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "price", "$ {0}") %>
</td>
</tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </ASP:Repeater> <!-- #include virtual="/quickstart/aspplus/samples/webforms/customize/footer.inc" --></body>
</html>
解决方案 »
- asp.net 中如何写过程和函数
- asp.net 利用模板实现WORD生成服务端部署问题
- 通过e.Row.DataItem 属性引用ProductsRow问题
- vs2005 内有Duwamish 7.0 源码吗?那为大哥能提供代码共享?
- 在使用FormView插入记录的时候,我怎么能够当点击插入按钮时,FormView的模式变成插入模式?
- 问一个关于用LDAPS Query 查询 Active Directory的问题
- Calendar 控件影响我的网页排版怎么办?
- 如何实现点击页面窗口的×触发事件,谢谢,很急,顶者有分!!!
- 急!IIS中网站做了修改,可访问后没有变化。
- 请问一下asp.net的程序怎么浏览,也是通过iis吗?
- 未将对象引用设置到对象的实例(在线等待)请各大虾帮忙
- some bullshit question about ASP.NET .
<HeaderTemplate>
<table border="0" width="100%" cellpadding="2" cellspacing="3">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td bgcolor="#cccccc">
<%# DataBinder.Eval(Container.DataItem,"标题") %>
</td></tr>
<tr>
<td bgcolor="#cccccc">
<%# DataBinder.Eval(Container.DataItem,"内容") %>
</td></tr>
</ItemTemplate>
<FooterTemplate>
</TABLE>
</FooterTemplate> </asp:repeater>
AspNetPager 免费分页控件4.0版发布,欢迎下载使用:http://www.webdiyer.com