Search for XML documents with DataSet and DataView

xiaoxiao2021-03-06  64

// speed slow (best using multi-thread) private void button1_click (Object sender, system.eventargs e) {DataSet DSProducts = new Dataset (); dsproducts.readxml ("g: //aaa//corp.xml"); DataView DV = New DataView (DSProducts.tables ["RECORD"]); // Depending on the XML set table name DV.Sort = "corp_id"; / / Sort this field

INT i = DV.FIND ("485"); / / Search String M_Corpname, M_Email; if (i == - 1) {MessageBox.show ("Nothing !!");} else {m_corpname = DV [i] ["corp_name"]. Tostring (); MessageBox.show ("Company Name: m_corpname); m_email = DV [i] [" email "]. Tostring (); messagebox.show (" email: " m_email);}}

转载请注明原文地址:https://www.9cbs.com/read-113674.html

New Post(0)