Posted on 2006-04-30
Last Modified: 2012-06-21
Hi XML Gurus,

We have a situation here.  We have the SP from SQL SERVER 2000 to create the XML OUTPUT.  THis contains multiple orders (one order to many lines);

We are using a VB.NET program to read this as a stream and create individual XMLs based upon the order.  ie., One XML file per order that has many lines.  

Exmaple: If there are 10 orders with many lines, it will create 10 different XML files.

We have the perfect UTF-8 output file from the SP.  NO issues here.  We can take output in a text format (OEM method) and view it in IE or MS WORD and successfully see the Japanese characters.

However, we just cannot reanme this file to XML as it throws an error .  We tried with UTF8 encoding too; no luck.

So, gurus:
1) Do we need to convert this text file taken out from the SQL SERVER 2000 via DTS package (OEM method)?
2) Does the VB.NET program need any special comonenents require for this?.

Someone in the forum has suggested to look into to convert from a Text file to XML.

Will this work?.

OR is there any other suggestions?.

Pl. help us out.

Thanks, VP
Question by:jsrams
    1 Comment
    LVL 26

    Accepted Solution

    Without seeing what you're producing, I don't think I can answer specifically.  But if your SP produces data using a Select, such as:

    Select * from Customers inner join Orders on Customers.CustomerID = Orders.CustomerID

    then you can get XML fairly easily using the FOR XML clause:

    Select * from Customers inner join Orders on Customers.CustomerID = Orders.CustomerID  FOR XML AUTO

    You can read this in as a stream, and it will preserve encoding just fine.  Once you have the XML as a stream, you're ready to do anything you want with it.  But I would avoid turning any part of it into a string, because you'll have to watch your encoding carefully.

    It would help if you could post a little of what you're calling "text format".  If it's plain text, with no XML markup, then it can't simply be renamed to XML. If it "looks" like XML, that's another story.

    In answer to #2, VB.NET doesn't exactly *require* any special components, but there is a toolset that I often use, called SQLXML, that can be used directly from VB.NET, and it provides a number of very nice ways of working with XML and SQL Server 2000.  If you have the .NET runtime installed when you install SQLXML, you'll get a set of managed classes you can use from .NET

    Once it's installed, you'll have a new program group called SQLXML 3.0 and it has an IIS configuration utility, and an excellent set of documentation on how it's used.  

    Mike Sharp


    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    XML problem with Internet Explorer 7 22
    xml read and write 3 50
    cleaning xml string 2 40
    D3, SVG, dragging a star. 2 82
    The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
    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.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    745 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

    14 Experts available now in Live!

    Get 1:1 Help Now