当前位置:编程学习 > C#/ASP.NET >>

XSLT / XML / C

XSLT / XML / C# (转)

这个例程展示了如何将xslt 应用于从数据库中读出的xml格式数据上. 例程完全使用C#语言编写:
using System;
using System.Collections;
using System.Data;
using System.Data.SqlClient;
using System.Xml;
using System.Xml.Xsl;
public class XsltTransform
    {
        public static void Transform()
        {
       SqlConnection nwindConn = new SqlConnection("Data
       Source=INMUMIS123;database=northwind;uid=sa;pwd=;");
       nwindConn.Open();
       DataSet custDS = new DataSet("CustomerDataSet");
       SqlDataAdapter custDA = new SqlDataAdapter("SELECT * FROM Customers",
       nwindConn);
       custDA.Fill(custDS, "Customers");
       SqlDataAdapter ordersDA = new SqlDataAdapter("SELECT * FROM Orders",
       nwindConn);
       ordersDA.Fill(custDS, "Orders");
       nwindConn.Close();
       custDS.Relations.Add("CustOrders",
       custDS.Tables["Customers"].Columns["CustomerID"],
补充:asp.net教程,XML应用
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,