70 likes | 135 Views
Chapter 7 Searching Your Products. Objectives: Use of GetRows() method. Use of Like Operator with SQL Select statement. Optimizing Search Page. Creating Indexable Web Pages. GetRows Method.
E N D
Chapter 7Searching Your Products • Objectives: • Use of GetRows() method. • Use of Like Operator with SQL Select statement. • Optimizing Search Page. • Creating Indexable Web Pages.
GetRows Method • The GetRows() method copies the contents of a Recordset into two dimensional array. The first index of the array represents the table column. The second index of the array represents the table row.
SQL Like Operator • The SQL like operator helps in using wildcard character. • % - Place holder that represents one/more characters. • _ -Place holder that represents one character. • Select * from products where p_name Like ‘%c’
Optimizing Search Page • Using Like operator to search terms is hard on database. • Microsoft has two products that you can use to add a more scalable search page to your web site. • Index server – To Search through static files. • Ms Full-text Search Service- to perform database search. It is included with MS SQL server.
Creating Index Web pages • Getting Web pages into internet search engine is extremely important to attract customer. • Inter search engine have problems with indexing pages generated from a database. • To get around this problem the trick is to convince the search engine that it is getting a static page when , in fact, it is retrieving a page generated from the database. • One easy way to do this is to take advantage of the Customer Errors Feature of IIS.
We need to create a special directory named product. Follow these steps: • Create a new directory on your computer’s hard drive named Products as a subdirectory of your Web site’s root directory. • Next, launch the Internet Service Manager and open the property sheet for this directory by right-clicking the products folder and selecting properties. • Choose the tab labeled Customer Errors. • We are going to create a customer error for error 404 File Not Found. Click the button labeled Edit Properties after selecting this error.
For Message Type, select URL. In the text box labeled URL, enter / product.asp. These entries will redirect to the ASP page named Product.asp when a file is not found in the products directory. • Click OK to save all your changes. • After you have completed the steps above, any ime someone requests a page from the Product directory, he will be redirected automatically to the Products.asp page. • Add the code 7.5 in text book. • When you request page from the products directory, you are automatically redirected to the Product.asp page. • The script retrives