Eleventh chapter The implementation that searchs inside Doking's BLOG station
Often see a lot of websites have function of the search inside a station, how is this to come true? If be ASP, that Dreamweaver can come true very quickly. Now is ASP.NET, a little the hand is made up.
11.1 Skill of SELECT advanced search
Learn paragraphicly above the course, to SELECT how many meeting nods understanding. Skill of SELECT advanced search, whats don't have actually mysterious, basically apply with what mode matchs operation accord with about. So here basically explains what mode matchs operation accord with to apply.
Mode matchs LIKE of operation accord with, NOT LIKE commonly used search at faintness, it judges a value to whether match with designation string format photograph. LIKE is used at searching to match the record of certain condition, NOT LIKE is used at searching not to match the record that appoints a condition. Can use at the type inquiry such as string, text, date.
1. 100 semicolon % : Can match the character of aleatoric type and length.
For example: LIKE of caption of WHERE of watch of note of study of FROM of SELECT study note " network % "
This inquiry is the caption in wanting inquiry study note to express with " network " all begun study take notes, be like: Network database ASP was passed, network and research of development of mobile phone communication.
For example: LIKE of caption of WHERE of watch of note of study of FROM of SELECT study note " %ASP.NET% "
This inquiry is to should inquire all caption were included " ASP.NET " study takes notes.
2. Underline _ : Match individual and aleatoric character, commonly used the character length that will restrict expression.
For example: LIKE of caption of WHERE of watch of note of study of FROM of SELECT study note " V_ develops concentration "
This inquiry basically is inquiry is similar to " VB development is handpick " , " VC development is handpick " the study of such caption takes notes.
3. In bracket [] : Appoint a character, string or limits, requirement place matched pair resembles the anyone that is them.
11.2 Functional implementation is searched inside the station
After introducing skill of SELECT advanced search, will introduce the implementation that the function searchs inside the station. 100 semicolon were used only here % mode match operation accord with.
(1) open pattern plate Dkblog.dwt.aspx, insert watch sheet, set ID= " Gofrm " , movement for " . . / Dkgo.aspx " , the method is " POST " ; Insert text casing, set ID= " Dkgotxt " ; Thrust button " search " , if pursue,as a result 11-1 place is shown.
(2) save pattern plate Dkblog.dwt.aspx to update all webpages.
(3) build dynamic page of a blank ASP.NET VB, save for Dkgo.aspx. Add data set Ztre, if graph 11-2 place is shown,its are installed.
Graph 11-1 Add concerned watch sheet to accuse
Graph 11-2 Add data set Ztre
(4) click " advanced " pushbutton, SQL command:
SELECT * FROM ZT ORDER BY ZITIME DESC
Instead:
SELECT * FROM ZT WHERE ZTNAME LIKE '%"+Request.Form("dkgotxt")+"%' ORDER BY ZITIME DESC
If pursue,as a result 11-3 place is shown.
Graph 11-3 undertakes modification to data set Ztre
(5) undertake concerned designing to Dkgo.aspx page, bind arrive about dynamic text surely in the page, design main area, if pursue,as a result 11-4 place is shown.
Graph 11-3 To the page setting of Dkgo.aspx
About the setting detail can consult the concerned setting of Index.aspx.

No comments:
Post a Comment