How to read XML and parse all child nodes

Here is a sample of my XML file and I want to be able to put into a grid the Server Name, User ID, Password, and then list under all Databases associated with that server.
<Servers>
  <Server>
    <Name>PROD_Server</Name>
    <Database>CUSTOMER</Database>
    <Database>LOCATION</Database>
    <Database>ORDERS</Database>
    <Database>RETURNS</Database>
    <UserID>RSMITH></UserID>
    <Password>$EWRaZ</Password>
   </Server>
   <Server>
    <Name>WEST_Server</Name>
    <Database>OPTIONS</Database>
    <Database>PRICES</Database>
    <UserID>THAMPTON></UserID>
    <Password>$EWRyAQ</Password>
   </Server>
   <Server>
    <Name>PASS_PLUS</Name>
    <Database>AUTOMOBILES</Database>
    <Database>VINNUMBERS</Database>
    <Database>OWNERS</Database>
    <UserID>BHARVEY></UserID>
    <Password>$VRRaZ</Password>
   </Server>
</Servers>
How can I do this?  

Hello,
Using the xml you supplied I see a master-detail relationship going on which is best shown in at least two DataGridView controls or the master table hooked up to a BindingSourceNavigator then child rows for Database in a DataGridview or label or TextBox
controls.
The code below loads the xml data into a DataSet then uses two BindingSource components to create a master-detail setup that can be setup say in Form load event
Dim ds As New DataSet
ds.ReadXml(IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "XMLFile1.xml"))
Master.DataSource = ds
Master.DataMember = ds.Tables(0).TableName
Details.DataSource = Master
Details.DataMember = ds.Relations(0).RelationName
DataGridView1.DataSource = Master
DataGridView2.DataSource = Details
Declare the BindingSource components at form level
Private Master As New BindingSource
Private Details As New BindingSource
Screenshot using two DataGridView controls.
I would suggest the above as other methods to place all columns into a DataGridView is problematic.
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my webpage under my profile
but do not reply to forum questions.

Similar Messages

  • How to read xml file and place it into an internal table...

    hello all,
    can any one help me in - how to read xml data file (placed in application server) and placing the same into an internal table (remove the xml tags or say fetching the xml data without xml tags).

    Hi Murashali,
    use this.
    TYPES: BEGIN OF day,
    name TYPE string,
    work(1) TYPE c,
    END OF day.
    DATA: BEGIN OF week,
    day1 TYPE day,
    day2 TYPE day,
    day3 TYPE day,
    day4 TYPE day,
    day5 TYPE day,
    day6 TYPE day,
    day7 TYPE day,
    END OF week.
    DATA xml_string TYPE string.
    DATA result LIKE week.
    week-day1-name = 'Monday'. week-day1-work = 'X'.
    week-day2-name = 'Tuesday'. week-day2-work = 'X'.
    week-day3-name = 'Wednesday'. week-day3-work = 'X'.
    week-day4-name = 'Thursday'. week-day4-work = 'X'.
    week-day5-name = 'Friday'. week-day5-work = 'X'.
    week-day6-name = 'Saturday'. week-day6-work = ' '.
    week-day7-name = 'Sunday'. week-day7-work = ' '.
    CALL TRANSFORMATION ...
    SOURCE root = week
    RESULT XML xml_string.
    CALL TRANSFORMATION ...
    SOURCE XML xml_string
    RESULT root = result.
    Regards,
    Vijay

  • How to read XML file and write into another XML file

    Hi all, I am new to JAVAXML.
    My problem is I have to read one XML file and take some Nodes from that and write these nodes into another XML file...
    I solved, how to read XML file
    But I don't know how to Write nodes into another XML.
    Can anyone help in this???
    Thanks in advance..

    This was answered a bit ago. There was a thread called "XML Mergine" that started on Sept 14th. It has a lot of information about what it takes to copy nodes from one XML Document object into another.
    Dave Patterson

  • How to read XML file and update the data in MS CRM 2011?

    Hi Folks,
    Can anyone please help me finding some references to read XML files and push the data to MS CRM 2011 preferably by using a console application.
    Please let me know if any ways of handling it in simple ways.
    Thanks,
    Sri

    HI,
    How to read XML file:
    https://social.msdn.microsoft.com/Forums/en-US/5dd7261b-86c4-4ca8-ba87-95196ef3ba50/need-to-display-xml-file-in-textboxes-edit-the-data-and-save-the-new-xml-file?forum=csharpgeneral
    How to work with CRM:
    ClientCredentials credentials = new ClientCredentials();
    credentials.Windows.ClientCredential = new System.Net.NetworkCredential("USER", "Password", "Domain");
    Uri uri = new Uri("http://server/Organization/XRMServices/2011/Organization.svc");
    OrganizationServiceProxy proxy = new OrganizationServiceProxy(uri, null, credentials, null);
    proxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
    IOrganizationService service = (IOrganizationService)proxy;
    //using "service" you can create, update and retrieve entities.
    More information here about service functions:
    https://msdn.microsoft.com/en-us/library/gg328198.aspx

  • How to read XML message present in Table using PL/SQL?

    Hi,
    How to read XML content present in Table using PL/SQL .And is it possible to parse the xml uisng xslt and insert xml output in same table again ?
    Thanks!

    Late reply, but hopefully better late than never.
    You can possibly do it all via a single SQL statement, such as {message:id=4232077}
    XMLTable Syntax can be found at http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions228.htm#CIHGGHFB (for 10.2 users) else find your correct version at http://www.oracle.com/technology/documentation/index.html

  • How to read xml file as shown below.

    Hello,
    I am using flash builder 4 and currently working on implementing AIR application.
    I need to read xml file data.
    Normal xml files are easy to read and i am much more aware of it.
    But can any one have idea how to read XML file which is given below.
    <node>
    <key>ID</key>
    <integer>1</integer>
    <key>Name</key>
    <string>Dhwani</string>
    <key>Postno</key>
    <integer>20</integer>
    <key>deskname</key>
    <string>flex</string>
    <key>empid</key>
    <integer>25</integer>
    <key>projectname</key>
    <string>abc</string>
    </node>
    Here i have xml file in form of key value pair. <key> node shows name of the key and after that <integer> or <string> node are the value for that specific key.
    if i select node.key then it shows me all the keys. and from that i cant make out what is the value for key ID.
    Is there any way to take first node and then second. i mean first i ll take value of key and store it into some arraycollection. and then value will be stored.
    Any help is appreciated.. Looking for positive reply.
    Thanks
    Dhwani

    There are different methods to access XML data which have pro's and cons. Let us know more about what you want to do and we can help you.

  • How to append an xml string as a child node to a dom document

    Hi
    I have an xml represented as a String. Now I want to add this xml string as a child node to another DOM Document.
    Do I have to first parse the xml String into a xml Document and then add the nodes to the existing Document. Is there a simpler way to do this. Any input is appreciated.
    Many thanks in advance.

    radsat wrote:
    Hi
    I have an xml represented as a String. Now I want to add this xml string as a child node to another DOM Document.
    Do I have to first parse the xml String into a xml Document and then add the nodes to the existing Document. yes, this is what you need to do.
    Is there a simpler way to do this. Any input is appreciated.no, there really isn't, sorry.

  • How to read XML SpreadSheet using OleDb Provider

    Hi All,
    I have generated an xml spreadsheet (*.xls) using XSL. I have another program that reads this spreasheet and processes it.
    Dim sConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + filnavn + ";" + "Extended Properties=Excel 8.0;"
    Dim objCon As OleDbConnection = New OleDbConnection(sConnectionString)
    objCon.Open()
    Dim objCmdSelect As OleDbCommand = New OleDbCommand("SELECT * FROM [General$]", objCon)
    Dim objAdapater As OleDbDataAdapter = New OleDbDataAdapter()
    objAdapater.SelectCommand = objCmdSelect
    Dim _DSGen As DataSet = New DataSet()
    objAdapater.Fill(_DSGen)
    I m facing an issue while opening a connection to the generated spreadsheet. It says "{"External table is not in the expected format."}".
    My Connection string is
    "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + filnavn + ";" + "Extended Properties=Excel 8.0;"
    Do i need to change anything to this string ? I tried using a dataset and calling dataSet.ReadXml(excelFileName); But the dataset doesnt contain my table. Any inputs on how to read an xml spreadsheet ?
    How to read XML SpreadSheet in OleDb? How to Convert XML SpreadSheet to Microsoft Office Excel Sheet?
    Many Thanks

    Hi,
    You'lll most likely have better luck posting this in a Microsoft forum. This forum deals with issues specific to querying the Oracle database via the Oracle OLEDB provider.
    Cheers,
    Greg

  • How to read the and Write the PDF file give me the solution

    Hi all,
    How to read the and Write the PDF file give me the solution
    My coding is
    import java.io.File;
    import com.asprise.util.pdf.PDFImageWriter;
    import com.asprise.util.pdf.PDFReader;
    import java.io.*;
    import java.io.FileOutputStream;
    public class example {
    // public example() {
         public static void main(String a[])
              try
              PDFReader reader = new PDFReader(new File("C:\\AsprisePDF-DevGuide.pdf"));
                   reader.open(); // open the file.
                   int pages = reader.getNumberOfPages();
                   for(int i=0; i < pages; i++) {
                   String text = reader.extractTextFromPage(i);
                   System.out.println("Page " + i + ": " + text);
    // perform other operations on pages.
    PDFImageWriter writer = new PDFImageWriter(new FileOutputStream("c:\\new11.pdf"));
                   writer.open();
                   writer.addImage("C:\\sam.doc");
                   writer.close();
                   System.out.println("DONE.");
    reader.close();
              catch(Exception e){System.out.println("error:"+e);
              e.printStackTrace();
    I get the pdf content then it returns the string value but ther is no option to write the string to PDF, and we only add a image file to PDF,but i want to know how to wrote the string value to PDF file,
    Please give response immtly
    i am waiting for your reply.
    thanks,
    Suresh.G

    I have some question flow
    How library to use this code.
    I try runing but have not libary.
    Please send me it'library
    Thank you very much!

  • There are hidden pages in the PDF form I have.  How can I see and print all without clicking on the

    I have hidden pages in the PDF form I'm using (but didn't create).  How can I see and print all the pages at once without clicking on the "next page" button.  In the initial view, there are four pages, but if I click the "next page" button, there are a total of 12 pages in this document.  This is three budget years, each year being 4 pages long.

    You're most likely dealing with a dynamic XFA form created in LiveCycle Designer. You can open it, click the button, and save it, and it will most likely be 12 pages when next opened, but it depends on how the form is set up. The ability to make edits to an XFA form in Acrobat is very limited, especially for dynamic forms, so things like flattening aren't possible.
    If it's not an XFA form, you'd still need to click the button at least once and save. To say for sure what's possible, I'd need to see the document. Can you post it somewhere?

  • How to read .xml file from embedded .swf(flash output) in captivate

    I have been trying to read .xml file from the .swf (Flash output) that is embedded within the captivate file but no luck yet . Please if anyone got any clue on how get this thing done using Action script 3.0 then let me know. I am using Adobe Captivate 5.5 at present and Flash CS 5.5.
    I am well aware about how to read .xml file through action script 3.0 in flash but when insert the same flash in captivate and publish nothing comes in captivate output. I would higly appreciate if anyone could help me out with that.
    Here is is graphical demonstration of my query :
    Message was edited by: captainmkv

    Hi Captainmkv,
    Does the information in this post cover what you're trying to do: http://forums.adobe.com/message/5081928#5081928
    Tristan,

  • How to read each and every word from a string.

    Hi all,
       I have a string which is having many label numbers. if the string is lv_str, its value is like, 11111111111111##22222222222222##3333333333333.
    I need to move the values alone into internal table. each value should be updated as a single row into one internal table. How to read each and every word of the string and move to an internal table.
    the internal table should be like this.
    11111111111111
    22222222222222
    3333333333333
    Can any one give me a suggestion in this regard.
    POINTS PROMISED.
    Regards,
    Buvana

    Hi,
    If you know the format and length of the data
    Use split at '#' so that you will get the individual values.
    Thean append it to internal table.
    Reward iof helpful.

  • My question is how can i find and redownload all my older apps ?

    HI,
    I have an Iphone 4, and bought mostly all of my Apps from my Iphone.
    I needed a certain App called Viber and tried to download it.
    I didn't work and it told me to download it from my computer (Macbook pro) Itunes,
    which i did, then i synched (my error) my iphone to my mac, then it erased all my apps from my iphone.
    My question is how can i find and redownload all my older apps ?
    Do i have to go find them manually and download them again?

    I'm guessing on the computer you connected to you were not logged into our account in iTunes and/or you never transferred your apps from your iPhone to your computer.
    Yes, you will need to download all of them again manually.

  • How to change country and keeping all application upgraded ? thx

    how to change country and keeping all application upgraded ? thx

    you may change the userID/ passwd from menu or create conn segment for each of the userID/ passwd combination .

  • TS1702 How do I reset and uninstall all information on my iPad. I want to return it?

    How do I reset and delete all information on my iPad. I want to return it?

    Settings>General>Reset>Erase all content and settings. Some people suggest signing out of your ID prior to erasing the iPad in Settings>iTunes & App Stores>Apple ID. Tap your ID and sign out.

Maybe you are looking for

  • Query variable entry - want modal dialog screen instead of full scr

    hi Is there a way to show query variable input screen as a dialog modal window rather than the default full screen mode? thanks. Message was edited by:         BWer

  • Query values in a form

    I'm trying to use a form to display query values and then pass a value to another page for processing. Here's part of my code <% rs = statement.executeQuery("SELECT * FROM users WHERE start_date > '7/1/2001'); %> <table> <form name = "form1" action =

  • 11gR2 Post-Upgrade Questions Regarding tnsnames, listener, pwd, and init

    Hello. Am planning on upgrading a significant # of RHEL5 10gR2 RAC and non-RAC DBs to 11gR2 (11.2.0.3.1, specifically). The servers are still not available to me, but I have been poring on the install and upgrade documents as well as referencing seve

  • Why won't i get the information email

    i forgot my id answers and it says that a retry like email and i won't get it!!! please help!

  • Headings: folders vs topics

    I'm currently trying to create printed documentation from existing online help. There is only one problem to which the answer eludes me: while RoboHelp automagically sets folder/subfolder headings to Heading1, Heading2 etc, it doesn't seem to do the