ÀûÓÃSqlHelper(ExecuteXmlReaderʹÓÃ)£¬×ª»»µ½xml¸ñʽ
ÀûÓÃsqlhelperÖеÄExcuteXmlReader·½·¨£¬¶ÁÈ¡Êý¾Ý²¢±£´æÎªxmlÎļþ
string strConn = Properties.Settings.Default.Connections;
SqlConnection connection = new SqlConnection(strConn);
---×¢Ò⣺ºóÃæµÄfor¸ñʽ
string strsql = "select * from p where name=@name and other=@other FOR XML AUTO,root('root'),elements";
SqlParameter[] sqlp = new SqlParameter[2];
sqlp[0] = new SqlParameter("@name", "pp");
sqlp[1] = new SqlParameter("@other", "ss");
xr = SqlHelper.ExecuteXmlReader(connection, CommandType.Text, strsql,
sqlp);
XmlDocument xml = new XmlDocument();
xml.Load(xr);
xml.Save(Application.StartupPath + "\\test1.xml");
Ïà¹ØÎĵµ£º
н¨xmlÎļþµÄÇé¿ö¿ÉÄܲ»¶à£¬µ«¶Ô½Úµã¡¢ÊôÐÔµÄÔöɾ¸Ä²é»áºÜ³£¼û
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(Server.MapPath("data.xml"));
ÕâÁ½¾äÓ¦¸ÃºÜ³£Óõ쬼ÓÔØÒѾ´æÔÚµÄxmlÎĵµ¡£
XmlNode root;//¸ù½Úµã
root = xmldoc.DocumentElement;//»ñÈ¡¸ù½ ......
<£¥@ page contentType="text/html; charset=gb2312" £¥>
<£¥@ page language="java"£¥>
<£¥@ page info="database handler"£¥>
<£¥@ page import="java.io.*"£¥>
<£¥@ page import="java.lang.*"£¥>
<£¥@ page import="java.util.*"£¥>
<£¥@ page import="java.sql.*"£¥> ......
¡¡¡¡Ò»¡¢ XML ¼ò½é
¡¡¡¡XML£¨Xtensible Markup Language£¬¼´À©Õ¹±ê¼ÇÓïÑÔ£©µÄ·¢Õ¹ÆðÔ´ÓÚ1996Äê¡£µ±Ê±£¬³ö°æ½ç¾ÞÍ·ºÍWebÒµÄÚÈËÊ¿¾¹ý¹²Í¬ÌÖÂÛ£¬Ìá³öÁË´´½¨SGML£¨Standard Generalized Markup Language£¬¼´±ê׼ͨÓñêʶÓïÑÔ£©×Ó¼¯£¨HML£©µÄ½¨Òé¡£¸Ã×Ó¼¯×¨ÓÃÓÚWeb£¬¾ßÓпÉÀ©Õ¹£¨»ò¿ÉÀ©³ä£©ÐÔ£¬²¢ÇÒÄÜÀûÓýṹ»¯±ê¼ÇÓïÑÔµÄËùÓÐ ......
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
private XmlDo ......
µ±Ò³ÃæÔØÈëʱ£¬»áÖ´ÐÐλÓÚ body ²¿·ÖµÄ JavaScript¡£
µ±±»µ÷ÓÃʱ£¬Î»ÓÚ head ²¿·ÖµÄ JavaScript ²Å»á±»Ö´ÐС£
2006Äê1ÔÂ14ÈÕ£¬John Resig ÔÚBarCampNYCÉϵÚÒ»´Î·¢²¼ÁËjQuery¡£
JSON(JavaScript Object Notation) ÊÇÒ»ÖÖÇáÁ¿¼¶µÄÊý¾Ý½»»»¸ñʽ¡£Ò×ÓÚÈËÔĶÁºÍ±àд¡£Í¬Ê±Ò²Ò×ÓÚ»úÆ÷½âÎöºÍÉú³É¡£Ëü»ùÓÚJavaScript£¨St ......