Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 19th, 2006, 06:50 AM
Registered User
 
Join Date: May 2006
Location: Chennai, , India.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with convert dataset to xml

Hi all
       i have a problem while converting dataset into xml

My XML format is

<test>
        <date>10-02-2006</date>
        <time>11.00 AM</time>
        <tranCount>4</tranCount>
        <tranDetail>
             <tranID>001</tranID>
             <tranID>002</tranID>
             <tranID>003</tranID>
             <tranID>004</tranID>
        </tranDetail>
</test>

<test> , <tranDetail> are two table

and i use stored procedure to populate tha dataset
stored procedure returns 2 tables as output.

and my problem is, when i try to convert it as xml
it displays output like this


<test>
        <date>10-02-2006</date>
        <time>11.00 AM</time>
        <tranCount>4</tranCount>
        <tranDetail>
             <tranID>001</tranID>
        </tranDetail>
</test>
        <tranDetail>
            <tranID>002</tranID>
        </tranDetail>
        <tranDetail>
             <tranID>003</tranID>
        </tranDetail>
         <tranDetail>
             <tranID>001</tranID>
        </tranDetail>

the first <trandetail> table is inserted within test sucessfully but remaining are come out of <test>

demoDS --> get results from stored proc

  i = demoDS.Tables(0).Rows.Count
        While i > 0

            dr1 = _outputDS.Tables("test").NewRow

            dr1("date") = demoDS.Tables(0).Rows(i - 1).Item(0)

            dr1("time") = demoDS.Tables(0).Rows(i - 1).Item(1)
            dr1("tranCount") = demoDS.Tables(0).Rows(i - 1).Item(2)

            _outputDS.Tables("test").Rows.Add(dr1)

            i = i - 1

        End While

        Dim dr, drx As DataRow

        i = demoDS.Tables(1).Rows.Count


        While i > 0
            dr = _outputAuditDS.Tables("tranDetail").NewRow
            dr("tranID") = demoDS.Tables(1).Rows(i - 1).Item(0)

            _output.Tables("tranDetail").Rows.Add(dr)


            i = i - 1

        End While


this is my code to form the xml file..

i thought the problem is in second while loop.

Please anyone help me to fix this

Ram

====
Ram


====
Ram
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert 1 big XML to multiple smaller XML victorcorey XSLT 1 March 20th, 2008 05:59 AM
Convert XML to XML template question bonekrusher XSLT 3 July 12th, 2007 07:47 AM
convert XML to XMl - Another Namespace question bonekrusher XSLT 2 July 10th, 2007 07:32 AM
Problem in convert Dataset to XML ram_kimi XML 0 May 19th, 2006 05:30 AM
Getting XML from DataSet monuindia2002 XML 1 March 19th, 2006 07:14 AM



All times are GMT -4. The time now is 02:12 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.