asp.net(c#) ±£´æxmlÊý¾Ý(½«Êý¾ÝдÈëµ½xmlÎļþÖÐ)
<?xml version="1.0" encoding="utf-8"?>
<bcaster>
<item item_url="images/nei1_03.gif" link="http://www.baidu.com" />
<item item_url="images/nei1_03.gif" link="http://www.baidu.com" />
</bcaster>
ÒªÏñÕâÖÖ¸ñʽµÄ
item_urlºÍlinkµÄÖµ¶¼ÊÇ´ÓÊý¾Ý¿â¶ÁµÄ
¸÷λ¸ßÊÖ°ïÏÂæ£¡
XMLDOCUMENT ¾Í¿ÉÒÔ½â¾öÁË
ÓÃXmlDocument.Save(ÕâÀïÊÇStream»òÕßXmlWriter)£¬¾Í¿ÉÒÔ±£´æÁË¡£
¿ÉÒÔÏÈͨ¹ýdatatable
C# code:
private string strconn="Provider=SQLOLEDB.1;User ID=sa;password=;Initial Catalog=ͨÐż;Data Source=lhz";
public OleDbConnection cn = new OleDbConnection();
public OleDbCommand cm = new OleDbCommand() ;
private OleDbDataAdapter da = new OleDbDataAdapter();
Xml XMLFile1=new Xml();
cn.ConnectionString=strconn;
cm.Connection=cn;
cm.CommandText="select CustID,CustName,QQ,Email from tongxin";
da.SelectCommand=cm;
DataSet ds=new DataSet();
da.Fill(ds,"tongxin");
try
{
ds.WriteXml(Request.MapPath(XMLFile1.xml));
}
catch(Exception)
{
}
finally
{
DataGrid1.DataSource=ds;
DataGrid1.DataBind();
}
{{-
Ïà¹ØÎÊ´ð£º
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.Design
Imports System.Web.UI.WebControls
Namespace CBDAspNet.WebControls.HTML
''' <summary>
'' ......
Êý¾Ý¿â±íÖÐÓÐÒ»ÁУ¨TranXml£©ÀàÐÍÊÇxml£¬´æ´¢µÄÊÇÀàËÆ
<fathernode>
<a>aaa
</a>
<b>bbb
</b>
</fathernode>
µÄÐÅÏ¢£¬²¢ÇÒͨ¹ý²éѯ·½· ......
<?xml version="1.0"?>
<root>
<status>433</status>
<msg>Õâ¸öÊǺº×Ö</msg>
<serialno>123</serialno>
</root>
ÈçºÎÓÃASP¶ÁÈ¡ statusÖµ ......
ÎÒ´´½¨ÁËÒ»¸öÎïÆ·ä¯ÀÀÒ³Ãæ£ºbookview.aspx£¬ÆäÖÐÔÚÒ³ÃæµÄ×ó²àÁгöÎïÆ·µÄ·ÖÀࣺ·ÖÀà1£¬Á¬½Óµ½Ò³Ãæbookview.aspx£¿id=1£¬ÆäËûÒÀ´ÎÀàÍÆ£¬µ±Ò³ÃæµÚÒ»´Î¼ÓÔØµÄʱºòÉèÖÃidµÄĬÈÏֵΪ1£¬ÔËÐгÌÐò·¢ÏÖÒ³ÃæÒ»Ö±³öÓÚÖØÐÂ¼Ó ......
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<video>
<device deviceid="\\?\usb#vid_0c45&pid_613b#5&2d0620de& ......