C#ÖÐString.EmptyÓë""
ÕâÁ½¸öÔÚÒ»°ãÇé¿öÏÂÊÇÏàµÈµÄ£¬µ«ÊÇϵͳ´¦Àí»úÖÆÉÏÈ´ÓÐËù²»Í¬¡£
""»áÔÚÄÚ´æÀï»®Ò»¿é³¤¶ÈΪ0µÄ´æ´¢¿Õ¼ä£¬¶øString.EmptyÄÚ´æ²¢²»ÎªËü·ÖÅä¿Õ¼ä£¬ËùÒÔÎÞÂÛÐÔÄÜ»¹ÊÇËÙ¶ÈÉÏString.Empty¶¼ÓÅÓÚ""¡£
Ôø¾¿´¹ýһƪÅжÏ×Ö·û´®¿ÕÖµµÄÐÔÄÜÎÄÕ£¬ÀÏÍâдµÄ¹úÈË·Ò룬ÎÄÕ´óÒâÈçÏ£º
¶ÔÓÚÒ»¸östringÀàÐ͵ıäÁ¿a£¬Äã»áÓÃÄÄÖÖ·½Ê½ÅжÏËüΪ¿Õ£¬Ò»°ãÓÐÒÔÏÂÈýÖÖ£º
a == ""
a == String.Empty
a.length == 0
ÄÇô£¬Äã»áÓÃÄÄÖÖ·½Ê½Åжϣ¿ÀÏÍâÎÄÕÂÖÐÖ¸³öЧÂÊÉÏ 3 > 2 > 1£¬Ò²¾ÍÊÇa.length == 0 > a == String.Empty > a == ""¡£
ÄÇô£¬½áÂÛÊÇ£¬¸³¿Õ×Ö·û´®ÇëÓÃString.Empty£¨NULL²»ÄÜÊä³ö£¬Empty¿ÉÒÔÊä³ö£©£¬ÅжϿÕ×Ö·û´®ÇëÓÃlength¡£
Ïà¹ØÎĵµ£º
¡¡SQLÖÐÓÐËÄÖÖ»ù±¾µÄDML²Ù×÷£ºINSERT£¬SELECT£¬UPDATEºÍDELETE¡£
INSERTÓï¾ä
¡¡¡¡Óû§¿ÉÒÔÓÃINSERTÓï¾ä½«Ò»ÐмǼ²åÈëµ½Ö¸¶¨µÄÒ»¸ö±íÖС£ÀýÈ磬Ҫ½«¹ÍÔ±John SmithµÄ¼Ç¼²åÈëµ½±¾ÀýµÄ±íÖУ¬¿ÉÒÔʹÓÃÈçÏÂÓï¾ä£º
¡¡¡¡INSERT INTO EMPLOYEES VALUES
¡¡¡¡ ('Smith','John','1980-06-10',
¡¡¡¡ 'Los Angles',16,45000);
¡¡ ......
C#
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("~/Config/User_yhlx_Jb.xml"));
DataView dv = ds.Tables[0].DefaultView;
//dv.RowFilter = "State=0";
this.DropDownList1.DataSource = dv;
this.DropDownList1.DataTextField = "text";
this ......
1£©XmlÎĵµÊ¾Àý£¨xmlsample.xml£©£º
Code
<?xml version="1.0" encoding="iso-8859-1" ?>
<music>
<song title="Oh,girl">
<artist>The Chi-lites</artist>
<genre>Soul</genre>
&nb ......
2£©ÈçºÎ´´½¨Ò»¸öxmlÎĵµ
ÓÉÓÚxmlʵÖÊÒ²Ö»ÊÇÒ»¸öÎı¾Îļþ£¬ËùÒÔ×î¼òµ¥Äã¿ÉÒÔÖ±½ÓʹÓÃSystem.IOϵÄÀàÉú³ÉÒ»¸öÎļþ£¬²¢´æ´¢³ÉxmlÎļþ£¬µ±È»£¬ÄãÐèÒªÊÖ¶¯±£Ö¤¸ÃÎļþÐÎʽÁ¼ºÃ£¬±ÈÈç±ØÐëÓиùÔªËØ¡¢±ØÐëÓйرձêÇ©¡¢±ØÐëÕýȷǶÌ׵ȵȡ£
Èç¹ûÄãÀÁµÃ×Ô¼ºÈ¥ÏëÎļþµÄÐÎʽ£¬¿ÉÒÔʹÓÃSystem.XmlϵÄÀà¡£
Code
Xml ......
3£©¶ÁÈ¡¡¢²éÕÒ
µ±ÄãÊÖÍ·ÓÐÒ»¸öxmlÎļþºó£¬¿ÉÒÔʹÓÃXmlDocument.Load()·½·¨½«Æä¼ÓÔؽøÀ´ÒԱ㴦Àí£¬ËùÒÔ“¶ÁÈ¡”ûÓÐʲô¿É˵µÄ¡£¶ø“²éÕÒ”²Ù×÷ÍùÍùÉæ¼°XPath£¬ÕâÀïÖ»ÊÇÎÒÈÏΪµÄ±È½Ï³£Óõ½µÄ²éÕÒ²Ù×÷£¬XPathÕâÍæÒâʵÔÚÊǺÜÇ¿´óºÜ±©Á¦¡£
»ØÍ·¿´Ê¾ÀýÎĵµxmlsample.xml£¬ÎÒÃÇ¿ÉÄÜÓöµ½ÕâÑùµÄÐèÇó£ ......