`
csstome
  • 浏览: 1528176 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

How To Use SQL XML ?

阅读更多

How To Use SQL XML ?

1.Program->Configure SQL XML Support in IIS

2. Create Virtual Directory

-2.1. Fill Virtual Name and Local Path

-2.2 Set Your Database Login User Name and Password

-2.3. Set SQL Server and Database

-2.4 Choice Setting Tab page -> Allow All

-2.5. Set Virtual Name.(Schema and Template in the Virtual Driver are have physics folder, Dbobject not have.)

-2.6 Click OK or Apply ->OK

3. Test SQL XML-> At the IE Address->

1. SQL In IE address

http://localhost/tr_xml?sql=SELECT+@@version+as+version+FOR+XML+RAW&root=root

2.XML File In IE address

<?xml version="1.0" encoding="utf-8"?>

<Menu xmlns:sql="urn:schemas-microsoft-com:xml-sql">

<sql:query>

SELECT Menu_ID,Menu_Name,Url,Status

FROM TB_Menu

FOR XML AUTO

</sql:query>

</Menu>

3. Use Style Sheet Display

XML Name: Menu_List.xml

<?xml version="1.0" encoding="utf-8"?>

<?xml-stylesheet type="text/xsl" href="Menu_List.xsl"?>

<Menu xmlns:sql="urn:schemas-microsoft-com:xml-sql">

<sql:query>

SELECT Menu_ID,Menu_Name,Url,Status

FROM TB_Menu

FOR XML AUTO

</sql:query>

</Menu>

XML Style Sheet Name: Menu_List.xsl

<?xml version='1.0' ?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

<xsl:template match="/">

<html>

<head>

<title>Menu List</title>

<base href="http://dg2pc0036/tr_xml/Template/" />

</head>

<body>

<table border="0" cellPadding="1" cellSpacing="1"

width="100%"

style="COLOR:black;FONT-FAMILY:Arial;FONT-SIZE:12pt.;FONT-WEIGHT:500">

<tr bgColor="#336699" align="center">

<TD><P ><STRONG><FONT color="white" size="2">Menu ID:</FONT></STRONG></P></TD>

<TD><P ><STRONG><FONT color="white" size="2">Menu Name:</FONT></STRONG></P></TD>

<TD><P ><STRONG><FONT color="white" size="2">Url:</FONT></STRONG></P></TD>

<TD><P ><STRONG><FONT color="white" size="2">Status:</FONT></STRONG></P></TD>

</tr>

<xsl:for-each select="Menu/TB_Menu">

<tr style="COLOR: black; FONT-FAMILY: Arial; FONT-SIZE: 0.8em; FONT-WEIGHT: 500">

<td bgColor="#F0F0F0"><xsl:value-of select="@Menu_ID"/></td>

<td bgColor="#F0F0F0"><xsl:value-of select="@Menu_Name"/></td>

<td bgColor="#F0F0F0"><xsl:value-of select="@Url"/></td>

<td bgColor="#F0F0F0"><xsl:value-of select="@Status"/></td>

</tr>

</xsl:for-each>

</table>

</body>

</html>

</xsl:template>

</xsl:stylesheet>

分享到:
评论

相关推荐

    Programming.Microsoft.SQL.Server.2000.with.XML

    I wrote this book for anyone who needs to understand how to use XML to integrate applications or organizations that store data in a SQL Server database. The book covers XML-related functionality in ...

    Beginning C# 2008 Databases From Novice to Professional

    How to use XML in database applications How to use LINQ to simplify C# database programming How to install SQL Server 2005 Express and Visual C# 3.0 Express and use them to teach yourself database ...

    How to Use Hibernate JPA

    - 可以选择安装Oracle、DB2或SQL Server等任何一种关系型数据库管理系统。 2. **创建数据库** - 如果不是使用Oracle数据库,则需要先创建一个新的数据库。 - 在创建数据库时,可以指定数据库的名称和字符集等相关...

    Pro LINQ: Language Integrated Query in C# 2010 (含源码)

    How to use LINQ to XML to revolutionize your creation, manipulation, and searching of XML data. How to query DataSets with LINQ to DataSet so you can coexist with legacy code and use LINQ to query ...

    Beginning XML with C# 2008: From Novice to Professional

    Developers wanting to use XML in the .NET Framework About the Apress Beginning Series The Beginning series from Apress is the right choice to get the information you need to land that crucial entry...

    XML Processing with Perl, Python, and PHP (2002).pdf

    Think about what you could do if only you knew how to tell Perl to convert your XML- based documents into Word documents for editing, or to HTML for viewing on the Web, or to SQL tables for storage in...

    Applied XML Programming for Microsoft .NET

    XML is everywhere in the Microsoft® .NET Framework, from Remoting to Web services and ... You’ll also get answers to common questions such as, “When should I use XML Web services instead of Remoting?

    C#学习的101个经典例子

    Framework - How-To Work with XML Framework - Key Benefits Framework - Partitioning your application Framework - role based security with Enterprise Services Framework - Scoping, Overloading, ...

    Microsoft SQL Server 2016: A Beginner’s Guide, 6th Edition

    From there, you will learn how to write Transact-SQL statements, execute simple and complex database queries, handle system administration and security, and use the powerful analysis and BI tools....

    Microsoft BizTalk Server 2010 Patterns

    how to use the previously defined WCF-SQL artifacts to make our processing solution more expressive and rich. The reader then learns how to use the business rules engine (BRE) to create powerful rules...

    LINQ中文学习资料和LINQ 随身参考手册

    plus query operators How to write efficient LINQ to SQL queries How to build expression trees from scratch All of LINQ to XML’s types and their advanced useLINQ promises to be the locus of a thriving...

    MyBatisCodeHelper-Pro.zip

    MyBatisCodeHelper-Pro插件免费版 Features Type safe sql support, plugin can recognize mybatis dynamic sql ...How to use view on https://github.com/gejun123456/MyBatisCodeHelper-Pro qqGroup:914051156

    Apress.Pro.LINQ.Language.Integrated.Query.in.C.Sharp.2008.Nov.2007.eBook-BBL

    - How to use LINQ to XML to revolutionize your creation, manipulation, and searching of XML data. - How to query DataSets with LINQ to DataSet so you can co-exist with legacy code...

    Essential LINQ

    In addition to covering core concepts and hands-on LINQ development in C# with LINQ to Objects, LINQ to XML, LINQ to SQL, and LINQ to Entities, they also present advanced topics and new LINQ ...

    beginning VisualBasic2010(英文版)入门必读

    You’ll learn to work with OOP memory management, class libraries, you′ll register assemblies, and see how to use third party class libraries.Chapter 14 provides an introduction to creating Windows ...

    hibernate_reference.pdf

    - **The Mapping File**: Here, you learn how to create an XML file that describes the mapping between your Java class and the corresponding database table. This includes specifying the table name, ...

    Beginning Microsoft Visual CSharp 2008 Wiley Publishing(english)

    Generating XML from LINQ to SQL 1041 How to Query an XML Document 1046 Summary 1053 Exercises 1053 Part V: Additional Techniques 1054 Chapter 30: Attributes 1056 What Is an Attribute...

    Firebird Maestro 17.1 带破解

    With Firebird Maestro you can view and edit table data (including BLOB fields), export and import data to/from MS Excel, MS Access, DBF, XML, TXT, CSV and other formats, get SQL data dump and more....

Global site tag (gtag.js) - Google Analytics