asp中想将控件的属性绑定到数据库应该怎样呢?
譬如让imgurl=dataset.tables(0).rows(0).item(0)?
下面是我原来做的.net的页面,有人能帮忙翻译成asp吗?
<%@ Import Namespace="SYStem.data" %>
<%@ Import Namespace="system.data.oledb" %>
<head ></head>
<body >
<script language="vb" runat="server" >
Dim a
dim b
dim c
Sub page_load()
Dim data1 = Now.Month & Now.Day & Now.Year
Dim connstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Inetpub\wwwroot\cld\db1.mdb "
Dim commstr As String = " SELECT imgpath ,hyperlink,text FROM(表1) WHERE (today =" & data1 &") "
Dim adapter1 = New OleDbDataAdapter(commstr, connstr)
Dim dataset1 As New DataSet()
adapter1.fill(dataset1, "db1")
a = dataset1.Tables(0).Rows(0).Item("imgpath")
b=dataset1.tables(0).rows(0).item(1)
c=dataset1.tables(0).rows(0).item(2)
Response.Write(b)
Response.Write(data1)
Response.Write(a)
TextBox1.DataBind()
End Sub
</script>
里面的数据表就是一个日期对应一个图片路径和超级链接和说明文字的。