SQL Server Static page export technology (SQL Server Web Assistant) 6

Source: Internet
Author: User
Tags date goto insert web database
server|web| Static | Page This article extracts from the Railway publishing house new "use BackOffice to establish Intranet/extranet application" (now in the Haidian book city has been sold, In the field or need door-to-door readers can go to www.wanbook.com.cn or www.e-bookshop.com.cn online purchase. The book number is ISBN7113039448). This book details how to use the Microsoft BackOffice family of products to build intranet/extranet applications. With it you will master the installation and setup of NT, use IIS to set up a Web site, set up a network conferencing system through ILS, create an enterprise mail and collaboration system with Exchange, build Web database applications with SQL Server, and use proxy Server establishes secure connections to the Internet, creates network TV/radio stations with Media server, builds powerful chat rooms with Chart server, builds personalized mailing lists with Site server, and analyzes access to Web sites, Use Commerce Server to establish business-to-business or business-to-consumer e-commerce sites. In addition, the book also discusses the security of the network, which guides you through a more robust and secure network application. After reading this book, you will find that the implementation of the rich and colorful network applications is so simple ...
Absolutely original, welcome to reprint. But make sure you keep the above text.


Finally, let's introduce the code for the part of the Export Date list page. We have previously produced a list page of dates through IDC technology, but the method used in static page export is different. The previous page generated by IDC through the browser side through Java to complete each date to produce the final page of work. This will cause the resulting paging file to be too large. Because for each date, include the following section of Java code:
<script>
Yue1=yue2;
yue2=4;
if (yue1!=yue2) {
tt=0;
if (yue1==0) {
document.write (' <table border= "BORDER" align= "CENTER" ><th><tr>}else{
document.write (' </tr></table> ')
document.write (' <table border= "BORDER" align= "CENTER" ><th><tr>}
}
ri=22;
xingqi=5;
if (tt!=0) {
if (xingqi<7) {
document.write (' <td><font size= "+1" ><a href= "goto.idc?day=1999-04-22" target= "goto" ><b>22 </b></a></FONT></td> ');
}else {
document.write (' <td><font size= "+1" ><a href= "goto.idc?day=1999-04-22" target= "goto" ><b>22 </b></a></FONT></td></tr><tr> ');
}
}else{
Tt=1;
For (I=1;i < xingqi;i++) {
document.write (' <td></td> ');
}
document.write (' <td><font size= "+1" ><a href= "goto.idc?day=1999-04-22" target= "goto" ><b>22 </b></a></FONT></td> ');
if (xingqi==7) {
document.write (' </tr><tr> ');
}
}
</script>
If you produce a page for one year's newspaper content, it may be larger than hundreds of KB. This is nothing for the LAN. This hundreds of KB of data can be caused by latency users are generally not aware of. Because it takes less than a second to transfer this data over a local area network. For Internet users, however, they have to consider their limited bandwidth. The delay caused by such a large paging file is probably unacceptable to the user. Therefore, you must reduce the size of this paging file. We use cursors and flow control statements to perform the corresponding judgment work on the server side when the static page is exported. Thus producing only "pure" HTML files. The following is the code snippet that implements this feature:
Declare
@dy int,
@date varchar (20),
@yue varchar (2),
@yue2 varchar (2),
@ri int,
@xingqi int,
@year int,
@outchar varchar (1600),
@tt int

CREATE TABLE # #daylist
(out varchar (1600))

Set @yue2 = ' 00 '
Set @tt =0

DECLARE POINT3 cursor FOR
SELECT DISTINCT
Dy=datepart (Dy,riqi), date=left (CONVERT (varchar), riqi,20), 10,
Yue=convert (varchar (2), DATEPART (Mm,riqi)), Ri=datepart (Dd,riqi), Xingqi=datepart (Dw,riqi), Year=datepart (Yy,riqi)
From Gaojian
where Kanwu = ' publication '
ORDER BY Year,dy
For Read Only

Open Point3
Fetch POINT3 into
@dy, @date, @yue, @ri, @xingqi, @year
while (@ @fetch_status =0)
Begin
If @yue <> @yue2
Begin
Set @tt =0
If @yue2 =0
INSERT INTO # #daylist
VALUES (' <table border= "BORDER" align= "CENTER" ><th><tr>' Year ' + @yue + ' month Else
INSERT INTO # #daylist
VALUES (' </tr></table><table border= "BORDER" align= "CENTER" ><th><tr>CONVERT (varchar (4), @year) + ' year ' + @yue + ' month End
If @tt <>0
If @xingqi < 7
Set @outchar = @outchar + ' <td><a href= ' + @date + '/index.htm ' target= ' new ' > ' +convert (varchar (2), @ri) + ' < /a></td> '
Else
Set @outchar = @outchar + ' <td><a href= ' + @date + '/index.htm ' target= ' new ' > ' +convert (varchar (2), @ri) + ' < /a></td></tr><tr> '



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.