The source code of some useful materials, especially for beginners, is found during data sorting. Most of them are commonly used knowledge points. You can refer to the implementation method and share it with everyone, but please do not use it for commercial purposes.
If it is useful to you, please share it with others.
Click the corresponding chapter title to download all the source code in this chapter.
Directory:
Chapter 5 HTML Development and Practice 15
2.1 use of the framework 16
Instance uses the FrameSet framework to layout the chat room 16
Instance 010 layout of the enterprise management system using the IFrame framework 17
2.2 Implementation of screen scrolling 18
Instance 011 rolling display blog announcement 18
Instance 012 scrolling effect and achieving hyperlink 20
2.3 common HTML controls 21
Instance 013 Input (Reset) Control for resetting 21
Instance 014 Table control layout logon page 22
Instance 015 Table control layout DataList template (employee information) 23
Instance 016 Select control achieves linkage effect (Select province and display the corresponding city) 25
Chapter 2 CSS style and JavaScript script application 27
3.1 control style 28
Instance 017 common control style 28
Instance 018 data control style 29
3.2 Link Control style 30
Instance 019 mouse click link style 30
Instance 020 mouse pointer slide over link style 31
3.3 page style 32
Instance 021 page overall style 32
Instance 022 scroll bar style 33
3.4 Menu Design 34
Instance 023 drop-down menu 35
Instance 024 interpretation menu 36
Instance 025 automatic hidden menu 38
3.5 Special Text effects 41
Instance 026 text flashing 41
Instance 027 text Scroll display 43
3.6 window control 45
Instance 028 open new window display advertisement information 45
Auto-closing advertisement window for instance 029 47
Instance 030 center display pop-up window 48
Instance 031 open new window Show Details 50
Cookie control 51 in the instance 032 pop-up window
Instance 033 is the pop-up window. Add the close button 52.
Instance 034 close pop-up window refresh parent window 54
When the main IE window is closed at instance 035, the dialog box 55 is not displayed.
3.7 webpage dialog box 56
Instance 036 page mode dialog box 56
Instance 037 pop-up full screen display page 58
Instance 038 web page color picker 60
Instance 039 date selector 62
3.8 others 63
Set instance 040 to homepage 64
Instance 041 favorites Site 65
Start favorites 66 When instance 042 leaves
Chapter 1 common Web server controls 67
4.1 display text with controls 68
Instance 043 display password format text 68
Instance 044 display long Date Format time 69
Instance 045 display amount format text 71
4.2 Use Controls to display images 72
Instance 046 display Verification Code image 72
Instance 047 dynamic display of user profile 73
Instance 048 use the webpage dialog box to display images 75
Instance 049 implements Image Upload 77
Instance 050 GridView control display employee Photo 79
4.3 Control hyperlink 80
Instance 051 ImageButton button to view product details 81
Instance 052 GridView use hyperlink template column to View Details 82
Use LinkButton In the instance 053 DataList control template to View Details 84
4.4 application of the drop-down list box 86
Instance 054 DropDownList control dynamic display of the GridView control index page 86
Linkage between provinces and cities of the 055 instance 88
Instance 056 add or delete email attachments 90
4.5 Application of Single-choice buttons 92
Instance 057 gender selection 92
Instance 058 Network Examination System single answer choice 94
4.6 check box application 96
Instance 059 login identity selection 96
Instance 060 option 98 for multiple answer questions in the Network Examination System
4.7 control connection data source 101
Configure AccessData Source 101 in The Wizard of instance 061
Instance 062 configure SqlData Source 103 through wizard
Instance 063 configure XmlData Source 106 through wizard
4.8 applications of the GridView control 108
Bind instance 064 data and implement paging 108
Instance 065 selecting, editing, canceling, and deleting data items 109
Instance 066 GridView implements positive/negative bidirectional sorting function 111
Bound to the Drop DownList control in the GridView control of instance 067 113
Add the template column 115 dynamically in the instance 068 GridView Control
Instance 069 Delete selected records through CheckBox 117
Instance 070 select more than 119 pages in the GridView control.
Instance 071 Delete the row information of the GridView control dialog box 121
Instance 072 automatically numbered 123 in the GridView Control
Instance 073 GridView control implements master table detail 124
Instance 074 view current row details 125
Use "…" in cell 075 of the Instance Replace 128 characters with ultra-long characters
Instance 076 controls the line feed of the content in the GridView control 129
4.9 data conversion between the GridView control and Excel 131
Instance 077: import the data in the GridView into Excel 131
Instance 078 reads data from Excel to the GridView control 133
Instance 079 export and format the data in the GridView to Excel 134
4.10 GridView control advanced application 135
The instance 080 can be dragged, sorted, and can change the width of the GridView 135
Auto sum, merge cells, and sort 138 in the instance 081 GridView Control
Instance 082 Supply and Demand Information Network review and release information 140
The cells in the instance 083 failed student scores are displayed as red 142
4.11 use the DataList control 143
Bind data to the instance 084 and implement pagination of 143
Instance 085 edit DataList control template display employee information 146
Instance 086 DataList control implements master table detail 147
Instance 087 DataList Control for deletion 149
4.12 Use of the Repeater control 151
Instance 088 Repeater control data binding 151
Instance 089 Repeater control page 153
Instance 090 edit Repeater control identification item information 155
Instance 091 Repeater control implements master table detail 157
Chapter 1 verification controls 5th
5.1 Communication Verification 162
Instance 092 verify email address and zip code 162
Instance 093 verification URL 165
Instance 094 verification phone number 166
5.2 date and time verification 168
Input Format of instance 095 verification Date: 168
Instance 096 verification time Input Format 170
Instance 097 verification Date and Time input format: 172
5.3 text and Numerical verification 174
Instance 098 verify that TextBox is empty 174
Instance 099 verify that the input value is in the specified range of 176
Instance 100 compares text 178 in two TextBox
Instance 101 verification ID number 180
Instance 102 verifies that the input text is 182 Chinese Characters
Instance 103 verify passport 183
5.4 custom verification 185
Instance 104 verify valid data table name 185
Instance 105 verify currency type 187
Chapter 2 advanced Web server controls 6th
6.1 create advertisement bar 190
Example 106 create a flag advertisement 190
Instance 107 floating advertisement 192
6.2 website navigation 194
Instance 108 HyperLink for simple website navigation 194
Instance 109 SiteMapPath control 195
Example 110 use the TreeView control to design the OA Office System navigation 197
Instance 111 use the Menu control to implement BBS navigation bar 199
6.3 use the logon control 200
Instance 112 use the Login control to achieve membership Login 200
Instance 113 use the CreateUserWizard control to create a new user login 202
6.4 Date and Time 203
Instance 114 view the news 203 of the specified date through the Calenda Control
Instance 115 calendar memo 205
6.5 use WebParts Control for personalized website 207
Instance 116 create a simple WebParts page 207
Instance 117 Add the user control 209 to the WebPart Control
Instance 118 modify the appearance and behavior of the WebPart control 209
Instance 119 users dynamically Add a WebPart control 211
6.6 user control 213
Instance 120 Site query and search 213
Instance 121 navigation bar control 215
Instance 122 link 216
6.7 other controls 217
Instance 123 use the Panel control to display or hide a group of controls 217
Instance 124 uses the ListBox control to implement the ordering function 219
Chapter 2 ADO. net technology 7th
7.1 database connection 224
Instance 125 establish Access database connection 224
Instance 126 establishes a connection with the encrypted Access database 225
Instance 127 create an SQL Server database connection 226
Instance 128 establishes an Oracle database connection 228
Instance 129 establish an ODBC data source connection 229
7.2 add 232 Data
Instance 130 add a single data record 232
Instance 131 add multiple item information 234
Instance 132 add files to the database 237
7.3 data update 239
Instance 133 update the specified record 239
Instance 134 batch update data 240
7.4 data deletion 242
Instance 135 delete a specified record 242
Instance 136 batch Delete record 243
Instance 137 delete all records 245
7.5 image access technology 247
Instance 138 stores the uploaded image name in the database 247
Instance 139 stores images in binary format to the database 248
Instance 140 reads the image name from the database and displays the image 250
Instance 141 reads and displays the image 251 stored in binary format in the database.
7.6 data backup and restoration 253
Instance 142 back up SQL Server database 253
Restore SQL Server database 143 by instance 256
7.7 transaction processing 259
Instance 144 application of transactions at Forum Registration 259
Application of instance 145 transactions in inserting multi-table data 261
Chapter 4 Data Binding Technology 8th
8.1 Data Source binding 264
Instance 146 formatting time and binding 264
Instance 147 DataBinder. Eval: bind the image path in the database to 265
Instance 148 Bind the DataList control using the Eval method or Bind method to display employee mail 267
Instance 149 Bind Variable 268
Instance 150 binding set 270
Instance 151 binding expression 271
Instance 152 binding method return value 272
Instance 153 binds a able object 273
8.2 control bound data 275
Instance 154 queries product details and binds them to the server control 275
Instance 155 binds recipe data in the database to The ListBox control 277
Instance 156 binds the news type to the DropDowenList control 278
Instance 157 binds the array to the Drop Down List control 280
8.3 XML data binding 281
Instance 158 binds the data in the XML file to the TreeView control 281
Instance 159 binds the data in the XML file to the GridView control 283
Instance 160 binds the data in the XML file to the Menu control 285
Chapter 2 SQL query related technologies 9th
9.1 SELECT clause 290
Instance 161 query data of a specific column 290
Instance 162 uses column alias 292
Add instance 163 to column calculation 294
Instance 164 use the function to set the condition 296
9.2 query constant 297
Instance 165 query number 297
Instance 166 query string 299
Instance 167 query date data 301
Instance 168 query Logical Data 302
Instance 169 query NULL data 304
9.3 query variable 306
Instance 170 query string data using variables 306
Instance 171 query numeric data using variables 308
Instance 172 query date data using variables 309
9.4 mode query 310
Instance 173 use the _ wildcard to query 311
Instance 174 use % wildcard to query 312
Instance 175 uses the [] wildcard to query 314
Instance 176 use the [^] wildcard to query 315
Instance 177 Complex Mode query 316
9.5 TOP and PERCENT limit query result 318
Instance 178: query the first 10 data records of 318
Instance 179 retrieve the first 10 data records of the statistical results 320
Instance 180 query sales accounted for 50% of the top 322 of Book Information
Instance 181: the number of queries in stock accounts for 20% of the total number of books.
9.6 period and date query 324
Instance 182 query data of the specified date 324
Instance 183
Instance 184 query data by month 328
9.7 comparison, logic, and repeated query 330
Instance 185 query data greater than 330 of the data specified by the condition
Instance 186 NOT combined with predicates query 332
Duplicate record 187 is not displayed during instance 334 Query
Instance 188 lists the number of duplicate records and records in data 336
9.8 use the or and operator 338 in queries
Instance 189 use OR for query 338
Instance 190 use AND for query 340
Instance 191 is used for both or and query 341
9.9 sorting and grouping statistics 343
Instance 192 grouping statistics (Single Column) 344
Instance 193 use the ALL keyword 346 in grouping Query
Instance 194 use the CUBE operator 349 in grouping queries
Instance 195 use ROLLUP 351 in group query
Instance 196 performs a descending query of data by 354
Instance 197 sorts data by multiple conditions 355
Instance 198 sorts the statistical results by 357
Instance 199 library inventory statistics by warehouse group (multiple columns) 358
Instance 200 multi-Table grouping statistics 360
Instance 201 uses COMPUTE 361
Instance 202 uses compute by 363
9.10 Aggregate functions 365
Instance 203 uses the aggregate function SUM to aggregate the sales amount by 365
Instance 204 uses the aggregate function AVG to calculate the average age of a class of students by 368
Instance 205 uses the aggregate function MIN to calculate 369 of the goods with the least sales and profit
Instance 206: 371 of employees who use the aggregate function MAX to obtain the most monthly sales
Instance 207 calculate the number of items with a daily sales value greater than a certain value using the aggregate function COUNT 373 instance 208 calculate the First or Last record 375 in the data table using the aggregate function First or Last
9.11 multi-Table query (connection query) 377
Instance 209 multi-Table query using the FROM clause 377
Instance 210 use table alias 379
Instance 211 Merge multiple result sets 380
9.12 nested query 382
Instance 212 simple nested query 383
Instance 213 complex nested query 384
Application of instance 214 nested query in query statistics 386
9.13 subquery 389
Instance 215 table 389 derived from a subquery
Instance 216 using subquery as expression 390
Apply the subquery 217 in the Update Statement of instance 392
9.14 union 393
Instance 218 use Union query 393
Instance 219 multi-table join query 395
Instance 220 sorts the combined query results by 397
Join Query within 9.15 398
Instance 221 simple internal connection query 398
Instance 222 complex internal connection query 400
Instance 223 use an inner join to select all rows related to the row of one table and the other table 401
9.16 outer join query 403
Instance 224 left outer join query 403
Instance 225 right outer join query 405
Instance 226 multi-table join query using external connections 406
9.17 use IN for query 407
Instance 227 use IN to introduce subqueries to limit the query range to 407
Instance 228 use IN to query record information IN the table 409
9.18 cross tabulation query 410
Instance 229 analyze data using Trasform 410
Instance 230 uses trasform to dynamically analyze data 412
Instance 231 static cross tabulation (SQLServer 2000) 414
Instance 232 Dynamic cross tabulation (SQLServer 2000) 416
9.19 function query 419
Instance 233 use the Formatting Function 419 in the query statement
Instance 234 use the string function 420 in the query statement
Instance 235 uses the date function 422 in the query
9.20 having statement application 423
Instance 236 uses the having statement to filter group data 423
Instance 237 having statement applied in Multi-Table query 425
Chapter 5 view, stored procedure, and trigger application 10th
10.1 view applications 428
Application view of instance 238 in ASP. NET 428
Instance 239 obtain all user views in the database 429
Instance 240 modify data 430 through View
10.2 Stored Procedure applications 431
Instance 241 ASP. NET application Stored Procedure 431
Instance 242 application Stored Procedure add data 433
Instance 243 application Stored Procedure modification data 434
Instance 244 app Stored Procedure delete data 436
Instance 245 ASP. NET application query Stored Procedure 437
Instance 246 obtains all stored procedures in the database 438
Instance 247 encryption Stored Procedure 439
10.3 trigger application 441
Application of instance 248 Insert trigger 441
Application of instance 249 Update trigger in system logs 443
Instance 250 trigger nesting use 444
Instance 251 get trigger 445 in Database
Chapter 2 ASP. NET built-in objects 11th
11.1 page transfer value 448
Instance 252 uses the Response. Redirect () method to pass a page value of 448
Instance 253 transmits the page address 449 through the Session object
11.2 obtain information 452
Instance 254 obtains the value transmitted between pages 452
Instance 255 obtains the client browser type 454
Instance 256 obtains the client and server IP address 455
11.3 online statistics 456
Instance 257 count online users by 456
Instance 258 count IP address logon times 458
Instance 259 calculates the user's online stay time by 460
Instance 260: Total website visits: 461
Instance 261 daily traffic statistics 464
11.4 chat room 466
Instance 262 uses the Application object to send 466 messages
Instance 263 uses the Application object for private chat 469
11.5 online voting 473
Instance 264 uses Cookie objects to prevent repeated voting 473
Instance 265 can only be voted once a month 475
11.6 shopping cart 477
Instance 266 view shopping cart 477
Instance 267 remove the specified item 480 from the shopping cart
Instance 268 clear shopping cart 481
Chapter 4 File Processing 12th
12.1 File Operations 486
Instance 269 file creation, movement, replication, and deletion operations 486
Instance 270 Modify file name 489
Simple read/write of instance 271 files 490
Instance 272 Modify text file 492
Instance 273 check whether the file exists 494
12.2 folder operations 495
Instance 274 create, move, and delete folders 495
Instance 275 modify folder name 497
Instance 276 check whether the folder exists 498
12.3 file upload and download 499
Instance 277 single file upload 500
Instance 278 multi-File Upload 501
Instance 279 upload image files and display 503
Instance 280 File Download 505
12.4 file traversal 506
Instance 281 traverses all files and directories in the specified directory 507
Instance 282 traverses the specified drive 508
12.5 online compression and decompression file 510
Instance 283 online compressed file 510
Instance 284 online decompression file 513
12.6 others 515
Instance 285 reads Registry Information 515
Instance 286 read drive information 517
Instance 287 obtains the basic information of the specified file 518
Chapter 2 graphic images and multimedia 13th
13.1 simple image rendering 522
Instance 288 GDI + draw line, rectangle and polygon 522
Instance 289 GDI + draws circular, elliptical, and slice 524
Instance 290 draw a rectangle with a shadow effect 525
13.2 draw Verification Code 526
Instance 291: Draw a mixed Verification Code of letters and numbers 527
Instance 292: Draw a Chinese character Verification Code 529
13.3 bar chart 531
Sample 293 bar chart analysis vote result 532
Instance 294 bar chart analysis website traffic 533
Example 295 bar chart analysis of automobile sales performance 536
Instance 296 use Office in ASP. NET to create a 3D component Statistical Chart 538
13.4 line chart 540
Instance 297 line chart analysis birth rate 540
Instance 298 line chart analysis product price trend 543
Instance 299 line chart analysis website Popularity Index 544
13.5 pie chart 546
Instance 300 pie chart analysis proportion of men and women 546
Instance 301 pie chart analysis product market share: 548
Instance 302 pie chart analysis of human resources 550
13.6 Avatar select 552
Instance 303 select Avatar 552 from the drop-down list
Instance 304 select Avatar 553 in the webpage dialog box
13.7 control and display image effects 555
Instance 305 controls the image size by using the mouse pulley 555
Instance 306 display random image 556
Instance 307 get the actual size of the image on the page 557
13.8 Flash Animation 558
Insert Flash Animation 308 to instance 559
Instance 309 insert background transparent Flash Animation 559
13.9 online playback and download 560
Instance 310 online VOD 560
Instance 311 MP3 File Download 563
Instance 312 homemade video player 565
Instance 313 online video with memory appreciation 567
Chapter 4 crystal report and printing 14th
14.1 print Web form 572
Example 314 print 572 using JavaScript
Instance 315 print 573 using WebBrowser
14.2 Print Image 575
Instance 316 Print Image 575
Instance 317 print resume 576
14.3 use report builder to design reports 578
Example 318 use report experts to design and display basic student information 578
Instance 319 grouping statistics report 582
Instance 320 Add a chart 584 IN THE CRYSTAL REPORT
14.4 operations on data sources and data in the Crystal Report 588
Instance 321 use Access database 588 IN THE CRYSTAL REPORT
Instance 322 use SQL Server database 590 in Crystal Reports
Instance 323 use an Excel worksheet 592 in a crystal report
Instance 324 cross-Data Source Query 595
14.5 operations on fields and text objects in the Crystal Report 599
The total order amount of instance 325 exceeds 0.1 million RMB, and the "Congratulations to the Award" text is 600
Instance 326 salary is greater than or equal to 10 thousand yuan marked with a blue font of 602
14.6 filter data in the Crystal Report 604
Instance 327 filters 1 million of items with monthly sales exceeding 605
Instance 328 screening 2000 of male employees with a salary of more than 607 yuan
14.7 grouping and sorting of data in a crystal report 609
Instance 329 library inventory statistics by warehouse grouping 609
Instance 330 is sorted by the total score in descending order by 610
14.8 crystal report calculation 612
331 of instance sales in 612 departments accounted for of the company's total sales performance
Instance 332 adds a pen Number of 613 to each data record by means of Accumulation
14.9 use of subreports 615
Instance 333 insert subreport 615
Instance 334 edit and re-import sub-Report 617
Instance 335 displays the subreport 620 as needed
14.10 ASP. NET calls Office to print 622
Instance 336 use Word to print employee report 622
Instance 337 use Excel to print the student information report 625
Chapter 2 XML technology 15th
15.1 read and write XML files 628
Instance 338 write XML file 628
Instance 339 reads XML file 630
Instance 340 modify XML file 631
Instance 341 reads XML data in SQL Server 632
15.2 XML file node operation 633
Instance 342 insert XML node 633
Instance 343 retrieval XML node 636
Instance 344 Delete XML node 637
15.3 XML file conversion 639
Instance 345 use XML file 639 on the HTML page
Instance 346 DataSet and XML file conversion 641
Example 347 XSL: Converting XML file 643
15.4 XML file encryption and decryption 645
Instance 348 encrypt XML file 645
Instance 349 decrypts XML file 647
Chapter 2 Web Service 16th
16.1 understand Web Services 652
Instance 350 create Web Service 652
Instance 351 calls Web Service to implement simple calculator 654
16.2 Web Services achieve database operations 657
Instance 352 data addition using Web Services 657
Instance 353 Web Service calls the stored procedure to delete data 659
16.3 Web Services implement communication functions 660
Instance 354 uses Web Service to send SMS messages 660
Instance 355 use Web Service to send e-mail 662
16.4 others 664
Instance 356 uploads and downloads images using Web Service 664
Instance 357 verification code technology 667 using Web Service
Instance 358 access server variable 669 from Web Service
Instance 359 use Web Service to implement product no. 671
Chapter 2 ASP. NET advanced applications 17th
17.1 access the Office file 674
Instance 360 access Word file 674 in the enterprise Document Management System
Example 361 Remote Education System Application PowerPoint teaching 675
17.2 email 676
Instance 362 use SMTP service to send email 676
Instance 363 uses the Jmail component to send an email 681
17.3 website search 683
Instance 364 generally searches for 683
Instance 365 Advanced Search 686
Instance 366 common search 690
Instance 367 add Baidu and Google search 691 to your website
17.4 ASP. NET application packaging and publishing 693
Instance 368 releases ASP. NET application 693
Instance 369 packaging ASP. NET application 695
17.5 others 698
Instance 370 converts a 15-digit ID card number to 18-digit 698
Example 371 simple use of the FreeTextBox component (Text Editor) 700
Instance 372 ASP. NET generate static Web page 701
Chapter 2 ASP. NET Security Mechanism 18th
18.1 User Login 706
Instance 373 normal login 706
Instance 374 Session Object judge User Login status 707
Instance 375 single-point logon 708 on the network
Instance 376 prevents SQL injection attacks 710
Instance 377 verification code technical login 712
18.2 data encryption technology 713
Instance 378 MD5 encrypted login user name and password 713
Instance 379 encryption and decryption DataSet 715
18.3 ACCESS Database Security 718
Instance 380 Access database backup and recovery 718
Instance 381 prevents Access database downloading 719
18.4 filter invalid characters 720
Instance 382 prohibits users from entering illegal characters 720
Instance 383 filters HTML illegal characters 721
Chapter 1 comprehensive example 19th
19.1 enterprise portal website 726
Instance 384 Key recommended software 726
Instance 385 announcement display and management on this site 728
Instance 386 friendship link implementation 730
Instance 387: Implement 732 of rolling ad Images
19.2 Blog 735
Instance 388 blog user image management function 735
Instance 389 comment Management page feature 738
Instance 390 administrator management process implementation 742
Instance 391 System Security Exit 744
19.3 Forum 746
Instance 392 view post information 746
Instance 393 post 749
Instance 394 reply post 751
Instance 395 Delete post and reply information 753
19.4 B2C e-commerce website 755
Instance 396 product management 756
Instance 397 member management 760
Instance 398 shopping cart implementation 763
Instance 399 product search 767
19.5 OA Office Automation System (workflow module) 768
Instance 400 System Management 768
Instance 401 work Application 772
Instance 402 lead approval 775
Instance 403 review 778
Chapter 2 website design and webpage color 20th
20.1 enterprise website 784
Instance 404 automobile sales 784
Example 405 pharmaceutical chain 785
Instance 406 hardware product 786
Instance 407 software product 788
Instance 408 logistics 789
Instance 409 hotel 790
20.2 E-Commerce 791 instances 410 B2C e-commerce 791
Instance 411 B2B e-commerce 793
20.3 search engine 794
Instance: 412 intra-Site Search Engine: 794
Instance 413 Internet search engine 796
20.4 institutional websites 797
Instance 414 government affairs 797
Instance 415 bank 798
Instance 416 news 799
20.5 Education Websites 800
Example 417 scientific research 800
Example 418 Colleges and Universities 802
20.6 lifestyle information 803
Instance 419 home 803
Instance 420 real estate 804
20.7 entertainment websites 805
Instance 421 Music Network 805
Example 422 movie network 807
Instance 423 game portal network 808
20.8 Supply and Demand Information 809
Instance 424 Talent Supply and Demand 809
Example 425 supply and demand of second-hand goods 811
20.9 others 812
Instance 426 personal homepage 812
Instance 427 gourmet network 814
Instance 428 Blog website (Blog) 815