求助:ASP.net实现显示数据表中的记录简单显示? what database are you using? if you are using SQL Server, tryselect top 10 * from yourtable order by time descthen use a templated datagrid to bind the data 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用datalist控件最好了...如下代码:在*.aspx中帮定数据:<asp:datalist id="DataList1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 88px" runat="server" BackColor="#ff6633" RepeatColumns="10" DataKeyField="id" Height="24px" Width="432px" OnItemCommand="SelectItem1"> <ItemTemplate> <asp:LinkButton id="Ttitle" Text='<%# Container.DataItem("title") %>' CommandArgument='<%# Container.DataItem("topic") %>' BackColor=#ff6633 ForeColor=#ffffff Runat="Server"/> </ItemTemplate> <asp:LinkButton id="time" Text='<%# Container.DataItem("time") %>' CommandArgument='<%# Container.DataItem("topic") %>' BackColor=#ff6633 ForeColor=#ffffff Runat="Server"/> </ItemTemplate>在*.aspx.vb中连接数据库写入查询语句:Dim comd1 As SqlCommand SqlConnection1.Open() comd1 = New SqlCommand("select ID,title,time from htjc", SqlConnection1) DataList1.DataSource = comd1.ExecuteReader() DataList1.DataBind() SqlConnection1.Close() </asp:datalist>好了...ok了!给分啊!!!!!!!!!! 想输出一个倒星三角,如何出来是个正星三角?如何改正? 存储过程建临时表 在asp.net页面中把数据导出到excel,如果电脑上装有迅雷,会下载页面的源码。请问如何屏蔽? DataList如何显示参差不齐的数据? VS.NET 2003 罢工,怎么办? 解码 簡單!!!送分來了~~~~~~~ 在datagrid的数据绑定列中如何格式化数据? 关于制作留言版[我是美工T_T] 为什么我用.net连SQL数据库时总是报错说aspnet登陆失败 Crob FTP Server并发用户测试,免费开放FTP,欢迎参加 把数据库链接的变量写成静态的好不好?
<asp:datalist id="DataList1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 88px" runat="server" BackColor="#ff6633" RepeatColumns="10" DataKeyField="id" Height="24px" Width="432px" OnItemCommand="SelectItem1">
<ItemTemplate>
<asp:LinkButton id="Ttitle" Text='<%# Container.DataItem("title") %>' CommandArgument='<%# Container.DataItem("topic") %>' BackColor=#ff6633 ForeColor=#ffffff Runat="Server"/>
</ItemTemplate>
<asp:LinkButton id="time" Text='<%# Container.DataItem("time") %>' CommandArgument='<%# Container.DataItem("topic") %>' BackColor=#ff6633 ForeColor=#ffffff Runat="Server"/>
</ItemTemplate>在*.aspx.vb中连接数据库写入查询语句:Dim comd1 As SqlCommand
SqlConnection1.Open()
comd1 = New SqlCommand("select ID,title,time from htjc", SqlConnection1)
DataList1.DataSource = comd1.ExecuteReader()
DataList1.DataBind()
SqlConnection1.Close()
</asp:datalist>好了...ok了!给分啊!!!!!!!!!!