扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
ID 自动编号
标题 字符串
署名 字符串
正文 备注。
2、guest.aspx
<%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.OleDb" %> <html><head> <style> <!-- body{font-size:9pt} p{font-size:9pt} td{font-size:9pt} //--> </style> <title>留言本</title></head> <body> <p align=right><font size=6>留言本</font></p> <script language=vb runat=server> Sub Page_Load(Source As Object, E As EventArgs) Dim myConn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source=" & server.mappath("data.mdb")) Dim myAdapter As New OleDbDataAdapter Dim myOleDbCommandBuilder As OleDbCommandBuilder = New OleDbCommandBuilder(myAdapter) Dim DS As DataSet = New DataSet myAdapter.SelectCommand = new OleDbCommand("select ID, 标题, 署名 from Guest order by id desc", myconn) myconn.open() myAdapter.Fill(ds, "Guest") ml.DataSource=ds.Tables("Guest").DefaultView ml.DataBind() end sub </script> <ASP:DataGrid id="ml" runat="server" Width="100%" BorderColor="black" ShowFooter="false" CellPadding=3 CellSpacing="0" Font-Name="宋体" Font-Size="9pt" HeaderStyle-BackColor="#ddaacc" EnableViewState="false" > <Columns> <asp:HyperLinkColumn DataNavigateUrlField="id" DataNavigateUrlFormatString="see.asp?id={0}" text="See!" Target="_new" /> </Columns> </asp:DataGrid> <br><br><font size=5>我要留言</font><br> <form method=post action=send.aspx> 标题:<input type=text name=title><br> 署名:<input type=text name=name><br> 内容:<textarea name=body></textarea><br> <input type=submit> </form> |
3、send.aspx
<%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.OleDb" %> <script language=vb runat=server> Sub Page_Load(Source As Object, E As EventArgs) Dim myConn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source=" & server.mappath("data.mdb")) Dim myInsertQuery As String = "insert into guest (标题, 署名, 内容) values (@#" & request("title") & "@#, @#" & request("name") & "@#, @#" & request("body") & "@#)" Dim myOleDbCommand As New OleDbCommand(myInsertQuery) myOleDbCommand.Connection = myConn myConn.Open() myOleDbCommand.ExecuteNonQuery() myOleDbCommand.Connection.Close() response.redirect("guest.aspx") end sub </script> |
4、see.asp(显示单个数据不如用ASP)
<html><head> |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者