The XMLManuInstructions sample application displays on-line directions for building products. The data for this application is retrieved from these columns in the Microsoft SQL Server AdventureWorks database:
-
Instructions column of XML type in Production.ProductModel table
-
Diagram column of XML type in the Production.Illustration table
Default Location:
drive:\Program Files\Microsoft SQL Server\90\Samples\
Engine\XML\XmlManuInstructions.
Scenario
A developer wants to create an application which accesses XML-based manufacturing directions from a web service and displays them.
Languages
Transact-SQL, XML, XSD, XSLT, Visual C# and Visual Basic.
Features
The XmlManuInstructions sample uses the following features of SQL Server 2005.
| Application Area | Features |
|---|---|
|
Overall |
XML, SQL Server-hosted web services |
Prerequisites
Before running this sample, make sure the following software is installed:
-
or (SQL Server Express). You can obtain SQL Server Express free of charge from the SQL Server 2005 Express Edition Documentation and Samples
Web site .
-
The AdventureWorks database, which is included with SQL Server 2005, and is also available from the SQL Server 2005 Express Edition Documentation and Samples
Web site .
-
The SQL Server 2005 Database Engine samples. These samples are included with SQL Server 2005 and are also included with the Microsoft Microsoft .NET Framework version 2.0 SDK 2.0.
-
.NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. See Installing the .NET Framework SDK.
Building the Sample
To build the sample you need to do the following:
Build the sample
-
Make sure the AdventureWorks sample database is installed.
-
In SQL Server Management Studio, load and execute the Scripts\install.sql script, or execute the following command in a command prompt window:
sqlcmd -E -I -i Scripts\install.sqlThis script creates the following:
-
GetManuInstructions stored procedure.
-
sql_AdvWorksEndPointManuInstrucions HTTP Endpoint.
-
GetManuInstructions stored procedure.
-
In Windows Explorer, right-click the CS\XmlManuInstructions folder where the sample was installed, click Properties, click the Web Sharing tab, click the Share this folder radio button, and then click OK twice. This creates an IIS virtual folder for the sample, which enables the application to work correctly.
-
Install the SVG viewer from
www.adobe.com/svg/viewer/install/main.html . Be sure to click Save As instead of Open.Note: To install the viewer you must have administrator privileges on your machine. Follow this procedure to install the viewer in the administrator context without having to log out of your current session. -
From the Run menu, type the command:
runas /user:Administrator cmd.
-
At the prompt, enter the Administrator password.
-
In the command shell, type the path to the svgview.exe file and press ENTER, such as C:\downloads\svgview.exe.
Note: Even if your user account has administrator privileges, you must run the installer on the account named “Administrator” or it does not work. -
From the Run menu, type the command:
-
CD to the install directory and execute the following at a .NET Framework or Microsoft Visual Studio 2005 command prompt:
sn -k keypair.snk -
Build the application using Microsoft Visual Studio 2005, or type the following in a command prompt window:
Running the Sample
To run the sample you need to do the following:
Run the sample
-
Run CS/XmlManuInstructions/bin/debug/XmlManuInstructions.exe.
-
Enter 7 for Product Model ID value. Click Show Instructions to see the fully rendered manufacturing instructions for the specified model. If you are curious about the format of the SOAP request, Click Show Request. If you are curious about the format of the SOAP response from SQL Server 2005 click Show Response. If you are curious about the XSLT file which rendered the instructions, click Show XSL. You can search the ProductModel table to find ProductModelID values for which products have XML manufacturing instructions stored.
Removing the Sample
To remove the sample, to do the following:
Remove the sample
-
Open the Scripts\cleanup.sql file in SQL Server Management Studio and execute the contents of the file, or execute the following command in a command prompt window:
sqlcmd -E -I -i Scripts\cleanup.sql