Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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¡£


Ïà¹ØÎĵµ£º

C#Êý¾Ý¿â±à³ÌÖ®»ù´¡sqlÓï¾ä

¡¡SQLÖÐÓÐËÄÖÖ»ù±¾µÄDML²Ù×÷£ºINSERT£¬SELECT£¬UPDATEºÍDELETE¡£
INSERTÓï¾ä
¡¡¡¡Óû§¿ÉÒÔÓÃINSERTÓï¾ä½«Ò»ÐмǼ²åÈëµ½Ö¸¶¨µÄÒ»¸ö±íÖС£ÀýÈ磬Ҫ½«¹ÍÔ±John SmithµÄ¼Ç¼²åÈëµ½±¾ÀýµÄ±íÖУ¬¿ÉÒÔʹÓÃÈçÏÂÓï¾ä£º
¡¡¡¡INSERT INTO EMPLOYEES VALUES
¡¡¡¡ ('Smith','John','1980-06-10',
¡¡¡¡ 'Los Angles',16,45000);
¡¡ ......

c# ´ÓXML¶ÁÊý¾Ý

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 ......

C#СTip£ºXml²Ù×÷¼òÃ÷ÊÖ²á 1


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 ......

C#СTip£ºXml²Ù×÷¼òÃ÷ÊÖ²á 2


2£©ÈçºÎ´´½¨Ò»¸öxmlÎĵµ
ÓÉÓÚxmlʵÖÊÒ²Ö»ÊÇÒ»¸öÎı¾Îļþ£¬ËùÒÔ×î¼òµ¥Äã¿ÉÒÔÖ±½ÓʹÓÃSystem.IOϵÄÀàÉú³ÉÒ»¸öÎļþ£¬²¢´æ´¢³ÉxmlÎļþ£¬µ±È»£¬ÄãÐèÒªÊÖ¶¯±£Ö¤¸ÃÎļþÐÎʽÁ¼ºÃ£¬±ÈÈç±ØÐëÓиùÔªËØ¡¢±ØÐëÓйرձêÇ©¡¢±ØÐëÕýȷǶÌ׵ȵȡ£
 
Èç¹ûÄãÀÁµÃ×Ô¼ºÈ¥ÏëÎļþµÄÐÎʽ£¬¿ÉÒÔʹÓÃSystem.XmlϵÄÀà¡£
 
Code
Xml ......

C#СTip£ºXml²Ù×÷¼òÃ÷ÊÖ²á 3

3£©¶ÁÈ¡¡¢²éÕÒ
µ±ÄãÊÖÍ·ÓÐÒ»¸öxmlÎļþºó£¬¿ÉÒÔʹÓÃXmlDocument.Load()·½·¨½«Æä¼ÓÔؽøÀ´ÒԱ㴦Àí£¬ËùÒÔ“¶ÁÈ¡”ûÓÐʲô¿É˵µÄ¡£¶ø“²éÕÒ”²Ù×÷ÍùÍùÉæ¼°XPath£¬ÕâÀïÖ»ÊÇÎÒÈÏΪµÄ±È½Ï³£Óõ½µÄ²éÕÒ²Ù×÷£¬XPathÕâÍæÒâʵÔÚÊǺÜÇ¿´óºÜ±©Á¦¡£
 
»ØÍ·¿´Ê¾ÀýÎĵµxmlsample.xml£¬ÎÒÃÇ¿ÉÄÜÓöµ½ÕâÑùµÄÐèÇó£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ