How to save time information on the server

Source: Internet
Author: User

Http://www.asp888.net bean curd technology station

<% @ Import namespace = "system. data. SQL" %>
<% @ OutputCache Duration = "3600" %>
/*
The prefix of OutputCache indicates this page.
The length unit of the server holding time is seconds.
Now I set the retention time of this program to 3600, that is, an hour.
In this way, even if you change the database data, the program will not ignore it.
It still shows your unmodified data.
*/
<Script language = "vb" RUNAT = "server">
Sub Page_Load (myList AS Object, E as EventArgs)
Dim dbRead AS SQLDataReader
Dim dbComm AS SQLCommand
Dim SQLserver AS String
Dim SQL AS String
Conn = "server = localhost; uid = sa; password =; database = doufu"
This is another method for connecting to the database. We do not need to create a SQLConnection.
'Nature is actually the same
SQL = "Select * from msgboard"
DbComm = New SQLCommand (SQL, conn)
DbComm. ActiveConnection. Open ()
DbComm.exe cute (dbRead)
While dbRead. Read ()
Here we briefly introduce the simple operation methods for dropdownlist in asp +.
Test. items. add (New ListItem (dbRead. Item ("msgTitle ")))
End While
End Sub
</SCRIPT>
<Form runat = "server" method = "get">
<Asp: DropDownList id = "test" runat = "server"/>
</FORM>


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.