C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » Windows »

How to get data from a merged xml file?


Posted Date: 01 Nov 2009      Posted By: ganeshkumar      Member Level: Bronze     Points: 1   Responses: 3



i have two XML files , (say room entry.XML and customer.XML)

room entry.XML has two child elements say(room no,room rent)

customer.XML also has two child elements say( customer id,customer name)

now i merge these files and formed another file(MERGED.XML)

i have a window form say(form1)

in that i have a data grid,

now my question is

how to populate the data grid with data from merged XML file(that MERGED.XML)






Responses

Author: Hari    01 Nov 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Hi,

You can do this

DataSet ds = new DataSet();
ds.ReadXml(MapPath("MERGED.xml"));
DataGrid1.DataSource = ds;
DataGrid1.DataBind();



Author: ganeshkumar    01 Nov 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

fine

but as my merged xml file looks like
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
</book>
- <Customer>
<CustomerName>Bob Frapples</CustomerName>
<PricePerUnit>5.95</PricePerUnit>
<ClosingDate>2001-12-16</ClosingDate>
</Customer>

now if i want both the data(customer,book ) to be populated in datagridview what should i do?

with the help of ur code i am populating only particular element

ie.only either customer or book element only populated in datagrid view

i need both to be populated .

what should i do?



Author: Nikhil Gaur    01 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

use this sample project. May be this could help you.

Join this campus group
http://www.dotnetspider.com/sites/637/-ecb-aspdotnet.aspx

Thanks & Regards
NIks
My Software and Web Development Experience



paypal.rar
Post Reply
You must Sign In to post a response.
Next : Disable mdi menu...
Previous : To add the contents of a selected excel file to the datagridview.
Return to Discussion Forum
Post New Message
Category: Windows

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use