[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

URGENT: Formatting ADO style XML

Asked by yamazed in C# Programming Language

Hi,

I am writing a windows form that will query the database.

string query = "SELECT TOP 2 * FROM Northwind.dbo.Customers" ;
DBQuery Q = new DBQuery() ;
bool result = dbCommander.RunQuery(query, true, ref Q) ;

if(result)
{
 stream = new MemoryStream(Q.DataAsByteArray, false) ;
 stream.Position = 0;
 XmlTextReader xmlReader = new XmlTextReader(stream);
 
 DataSet ds = new DataSet();
 ds.ReadXml( xmlReader );

 // does not give me anything...
 Debug.WriteLine(  ds.GetXml()  );          
                         
 xmlReader.Close() ;
}


Here is typically ADO style XML stream I recieve from the queries I send to the database:

<xml version="1.0" encoding="UTF-16">
    <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
        xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
        <s:Schema id="RowsetSchema">
            <s:ElementType name="row" content="eltOnly" rs:CommandTimeout="30">
                <s:AttributeType name="CustomerID" rs:number="1" rs:writeunknown="true">
                    <s:datatype dt:type="string" dt:maxLength="5" rs:fixedlength="true" rs:maybenull="false" />
                </s:AttributeType>
                <s:AttributeType name="CompanyName" rs:number="2" rs:writeunknown="true">
                    <s:datatype dt:type="string" dt:maxLength="40" rs:maybenull="false" />
                </s:AttributeType>
                <s:AttributeType name="ContactName" rs:number="3" rs:nullable="true" rs:writeunknown="true">
                    <s:datatype dt:type="string" dt:maxLength="30" />
                </s:AttributeType>
                <s:AttributeType name="ContactTitle" rs:number="4" rs:nullable="true" rs:writeunknown="true">
                    <s:datatype dt:type="string" dt:maxLength="30" />
                </s:AttributeType>
                <s:AttributeType name="Address" rs:number="5" rs:nullable="true" rs:writeunknown="true">
                    <s:datatype dt:type="string" dt:maxLength="60" />
                </s:AttributeType>
                <s:AttributeType name="City" rs:number="6" rs:nullable="true" rs:writeunknown="true">
                    <s:datatype dt:type="string" dt:maxLength="15" />
                </s:AttributeType>
                <s:AttributeType name="Region" rs:number="7" rs:nullable="true" rs:writeunknown="true">
                    <s:datatype dt:type="string" dt:maxLength="15" />
                </s:AttributeType>
                <s:AttributeType name="PostalCode" rs:number="8" rs:nullable="true" rs:writeunknown="true">
                    <s:datatype dt:type="string" dt:maxLength="10" />
                </s:AttributeType>
                <s:AttributeType name="Country" rs:number="9" rs:nullable="true" rs:writeunknown="true">
                    <s:datatype dt:type="string" dt:maxLength="15" />
                </s:AttributeType>
                <s:AttributeType name="Phone" rs:number="10" rs:nullable="true" rs:writeunknown="true">
                    <s:datatype dt:type="string" dt:maxLength="24" />
                </s:AttributeType>
                <s:AttributeType name="Fax" rs:number="11" rs:nullable="true" rs:writeunknown="true">
                    <s:datatype dt:type="string" dt:maxLength="24" />
                </s:AttributeType>
                <s:extends type="rs:rowbase" />
            </s:ElementType>
        </s:Schema>
        <rs:data>
            <z:row CustomerID="ALFKI" CompanyName="Alfreds Futterkiste" ContactName="Maria Anders"
                ContactTitle="Sales Representative" Address="Obere Str. 57" City="Berlin" PostalCode="12209"
                Country="Germany" Phone="030-0074321" Fax="030-0076545" />
            <z:row CustomerID="ANATR" CompanyName="Ana Trujillo Emparedados y helados" ContactName="Ana Trujillo"
                ContactTitle="Owner" Address="Avda. de la Constitución 2222" City="México D.F." PostalCode="05021"
                Country="Mexico" Phone="(5) 555-4729" Fax="(5) 555-3745" />
        </rs:data>
    </xml>

I know I could use the XmlDocument but what I would like to achieve is getting the DataSet table mapping of several tables which I do not think I could achieve with XmlDocument (unless I am wrong)... As far as I personally think I do not think the DataSet can handle this form of XML. I think I will need to first parse it to a more likeable XML format the DataSet will be able to recognize.

How could I parse the XML above to something a more common XML format?



Thanks,

~yamazed
 
Related Solutions
Keywords: URGENT: Formatting ADO style XML
 
Loading Advertisement...
 
[+][-]03/16/05 06:19 PM, ID: 13561588Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: C# Programming Language
Sign Up Now!
Solution Provided By: testn
Participating Experts: 1
Solution Grade: B
 
[+][-]03/16/05 11:16 AM, ID: 13558619Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/16/05 05:39 PM, ID: 13561440Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/16/05 07:59 AM, ID: 13797655Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]04/23/05 05:40 AM, ID: 13849635Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]04/27/05 04:26 AM, ID: 13874882Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92