xml ºÍ datagridview
°ÑxmlÖÐij¸ö½ÚµãµÄÖµµÄÄÇÒ»ÐÐÏÔʾµ½datagridviewÖС£
ÀýÈçxmlÖзûºÏ <Name>"СÃ÷"</Name> £¨ËùÓÐNameµÄֵΪСÃ÷µÄÐÐÑ¡³öÀ´´ÓxmlÖÐ È»ºóÏÔʾµ½datagridviewÖУ©
Ïȷŵ½·ºÐÍÀàÖаÉ
Ïȷŵ½·ºÐÍÀàÖаɡ£
Ôõô¸ö×ö·¨ÄØ¡£¡£¸øµã´úÂë°ÉÉÔ΢¡£¡£
string str1 = "";
str1 = listBox1.SelectedItem.ToString();
foreach (DataRow dr in dataSet1.Tables["User"].Rows)
{
if (dr["Net"].ToString() == str1)
{
//
}
}
//Ïë°Ñ»ñÈ¡µÃµ½µÄÕâÒ»ÐÐÈ¡³öÀ´£¬·Åµ½xmlÖУ¬È»ºóÔÙÓÃdatagridview¶ÁÈ¡£¿
XML½á¹¹ÊÇʲôÑù
XmlNodeList nodelist= xmldoc.SelectSingleNode("a/BB[@name='']").ChildNodes
±éÀú¶Áȡֵ
»òDataset
¼òµ¥µÄ×ö·¨£¬½«xmlÎĵµ¼ÓÔØµ½datasetÈ»ºóʹÓÃdatatableµÄselectº¯Êý£¬Ñ¡Ôñname='СÃ÷'µÄËùÓÐÐÐ
»Ø¸´sq_zhuyi
Äã¿ÉÒÔдϲ»
DataSet ds = new DataSet();
ds.ReadXml("c:/a.xml");
DataRow[] rows = ds.Tables[0].Select("name='СÃ÷'");
½«rows°ó¶¨¸øgrid
Ïà¹ØÎÊ´ð£º
´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽ
XML code:
<folder state="unchecked" label="È«²¿">
¡¡¡¡ <folder state="unchecked&qu ......
´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽÎļþ
<folder state="unchecked" label="È«²¿">
¡¡¡¡<folder state="unchecked" isBra ......
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎͼ¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......
ÈçºÎÌí¼ÓXML½áµãºÍÏà¶ÔÓ¦µÄÖµ¡£Çë´ó¼Ò°ï°ïæ
---------------------------------------
Asp.Net,C#,SQL,JS,WCF,AJAX,¹¤×÷Á÷,WPF,MVC,LINQ,Éè¼ÆÄ£Ê½(¼Ü¹¹)µÈ¼¼ÊõÌÖÂÛ
¡°ASP.NET(C#)Fans¡± QQȺ£º96877690 ......