Retrieving Data SQL from Database

Domain Hosting image
Web Hosting
Dedicated server
ssl certificate
Web Design image
Email

There are two different methods of generating XML from within SOL Server. You can either use Web Assistant Wizard, to create Web Tasks, which are automated tasks that run at specific intervals and generate either HTML or XML files, or you can use stored procedures to return results sets that are formatted into XML. In this chapter we will be using Web Assistant Wizard to create Web Task that generates the XML file, which retrieves the data from SOL database and displays it in the browser.

Microsoft's SOL Server has a feature, which is meant to make the generation of HTML files from SOL statements easy. Since these types of reports are the same for all people who wish to review them, there is no reason to build custom Web software that interactively queries for the data and builds HTML results. All that really needs to happen is for a single session to. be created that generates one or more HTML pages. This is what Web Tasks were designed for. Web Tasks were meant to generate HTML. An XML specification had not been completed when Web Tasks were added to SOL Server. Web Tasks automatically creates the XML file based on the template created by the user and the settings given in the Web Assistant Wizard. This XML files retrieves the data from SOL Server and displays it to the user, when viewed from the browser.

In the following exercise we will create a table called " BookInfo" with the columns BName, Author, AuthorADD, Phone, Publisher and PublisherADD in SOL Server database and insert few rows. We will create a template file called Booklnfo.tpl and use the Web Assistant Wizard to create the Booklnfo.xml file. The real flexibility of the template feature of SOL Server is the ability to use it to generate XML. The server does not care whether the f ile contains anything other than the keywords it uses to insert current row data.

In this exercise we will create three files, one template file called Booklnfo.tpl, one DTD file called BookInfo.dtd and one CSS file called BookInfo.css. In the following template file the keywords <%begindetail%>, <%enddetail%> and <%insert data here%> are the ASP code,used to fetch the data from SOL database. <%begindetail%> and <%enddetail%> are used to mark the area where a given SOLquery's results set should be used to fill the <%insert data here%> statements. <%insert data here%> keyword indicates where column data should be placed from the results set.



Domain Name Search

www.


Copyright (C) 2007. Web Domain design hosting. All rights reserved.