How best to return XML from a function (VB .net 2003, 7.1)

Posted on 2007-07-25
Last Modified: 2012-05-05
I'm writing a VB (.net 2003, 7.1) application. It is to return XML, maybe several thousand lines worth. Not really a huge amount of data. (The receiving function may just write the XML out to a file, I don't know, not my job). I could have VB return an array of Strings but I'm wondering if there is any better ways to returning this type of data. Not binary, just ASCII lines. I've "heard" about streaming but know NOTHING about it. So I leave it up to the experts to advise me as to a better way to return XML like data. Maybe an array of Strings is the best way. Details are appreciated. Let me know!!

Dave P
Question by:aerol
    LVL 18

    Assisted Solution


    You could return a string object
    You could return an XMLDocument object.

    There are loads of ways of returning it.

    Do you also have to build the XML from raw data?


    LVL 10

    Accepted Solution

    I would save the xml to a memory stream and pass the memory stream back. You work with the memory stream as you would a file stream.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Suggested Solutions

    Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now