This routine shows how to apply xslt to xml format data read from the database. The routine is fully written in C:
Using System;
Using System. Collections;
Using System. Data;
Using System. Data. SqlClient;
Using System. Xml;
Using System. Xml. Xsl;
Public class implements ttransform
{
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 mers ",
NwindConn );
CustDA. Fill (custDS, "MERS ");
SqlDataAdapter ordersDA = new SqlDataAdapter ("SELECT * FROM Orders ",
NwindConn );
OrdersDA. Fill (custDS, "Orders ");
NwindConn. Close ();
CustDS. Relations. Add ("CustOrders ",
CustDS. Tables ["MERS"]. Columns ["CustomerID"],
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.