Click here to Skip to main content
15,887,333 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
how to search a particualr field in xml via vb.net
plsss help

below is my xml file


XML
<?xml version="1.0" standalone="yes"?>
<DsXmlDbDemo xmlns="http://tempuri.org/DsXmlDbDemo.xsd">
  <Customers>
    <CustomerId>1</CustomerId>
    <Name>dfgdfg</Name>
    <Address1>dfgdfg</Address1>
    <Address2>dfgdfg</Address2>
    <City>dfgdfgdf</City>
    <St>dfgdfg</St>
    <Zip>45646</Zip>
  </Customers>
  <Customers>
    <CustomerId>2</CustomerId>
    <Name>asfdasd</Name>
    <Address1>sedufsufh</Address1>
    <Address2>sdoifo</Address2>
    <City>efef</City>
    <St>sdfsf</St>
    <Zip>6656</Zip>
  </Customers>
</DsXmlDbDemo>
Posted
Updated 12-May-13 19:52pm
v3

Omkaara wrote:
I'am using VS 2005, 2.0. Framework Linq is not available in VS 2005.
If you cannot use .NET Framework of the versions above v.2.0, you will have to use other means of working with XML and develop the search by yourself. Please see my short overview:

XML Read/Write:

  1. Use System.Xml.XmlDocument class. It implements DOM interface; this way is the easiest and good enough if the size if the document is not too big.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^].
  2. Use the classes System.Xml.XmlTextWriter and System.Xml.XmlTextReader; this is the fastest way of reading, especially is you need to skip some data.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmlwriter.aspx[^], http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx[^].
  3. Only for .NET Framework v.3.5 or later: Use the class System.Xml.Linq.XDocument; this is the most adequate way similar to that of XmlDocument, supporting LINQ to XML Programming.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^], http://msdn.microsoft.com/en-us/library/bb387063.aspx[^].


—SA
 
Share this answer
 
v2
 
Share this answer
 
Comments
Omkaara 13-May-13 1:45am    
i am using vs 2005 2.0 framework linq is not availble in vs 2005
Sergey Alexandrovich Kryukov 13-May-13 1:51am    
What keeps you at v.2.0? It was a (practically, first) decent .NET version, but you will have more and more problems in getting help, as most will answer using more recent feature. At least tag .MET 2.0 when asking questions.

—SA
Omkaara 13-May-13 1:55am    
most of end users are still on microsoft xp so i have to create my software in vs 2005
Sergey Alexandrovich Kryukov 13-May-13 2:00am    
XP can use .NET v.3.5 and v.4.0. Not a good excuse.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900