asp.net从数据库读取文字怎样排版好点,是vb语言的
如题:<%@ import NameSpace="System.Data" %>
<%@ import NameSpace="System.Data.OLEDB" %>
<Script Language="VB" Runat="Server">
sub page_load(sender as object,e as eventargs)
dim i,a,b,c as integer
c = Request.QueryString("NewsId")
dim conn as new OLEDBConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("News.mdb"))
Dim cmd1 As New OLEDBCommand("select * from TB_News where NewsID='" & c & "'",conn)
conn.open()
dim dr as oledbdatareader=cmd1.Executereader()
if dr.read() then
l1.text &="<font size=5>" & dr.item("Newstitle") & "</font>" & "<br><br>"
l1.text &=dr.item("Time") & "<br><br><hr>"
'l1.text &= dr.item("Newl")
l1.text &= dr.item("NewS")
aa.text &="<img src=" & dr.item("Picture") & ">"
end if
end sub
</Script>
<Html>
<head>
<title>欢迎来到新浪军事新闻中心</title>
</head>
<Body>
<h4 align="center">新浪军事新闻中心</h4>
<hr noshade>
<Form Runat="Server">
<center><asp:label id="l1" runat="server"/></center>
<asp:label id="aa" runat="server" align="left"/>
</Form>
</Body>
</Html>
显示如下: 排版 数据库 asp.net
[解决办法]
看这个例子吧http://dotnet.chinaitlab.com/ASPNET/19699.html
[解决办法]
http://blog.csdn.net/zhangj1012003_2007/article/details/4428051