473,387 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Hierachical data binding

I have an existing XML file that I read into a data set ds. The XML is
hierarchical; i.e., it looks like

<A>
<B>
<C>
<D> element1<\D>
<E> element2<\E>
<\C>
<C>
<D> element3<\D>
<E> element4<\E>
<\C>
<\B>
<\A>

I created a schema based on the XML.
A, B, and C appear as individual dataTables in the dataset. I then bind
dataTable C to a dataGridView. Elements <D> and <E> get shown properly in
the dataGridView in two rows, one per each <C>.

If I save the dataset XML (using ds.WriteXML() ), I get back the original
XML file with the correct hierachy.

Then I added a new row in the dataGridView. When I now save the dataset XML,
dataTable C is saved as its own dataTable rather than being under <C>. In
other words, the above dataset appears as
<A>
<B>
<C>
<D> element1<\D>
<E> element2<\E>
<\C>
<C>
<D> element3<\D>
<E> element4<\E>
<\C>
<\B>
<C>
<D> element3<\D>
<E> element4<\E>
</C>
<\A>

My question (finally) is how do I save the new row I put into the
dataGridView in the correct hierarchy.

Thanks.

Chuck Gantz
Dec 6 '05 #1
1 1072
Chuck,

Have a look for "Nested Dataset" on MSDN.

I did it for you,
http://search.microsoft.com/search/r...nested+dataset

I have looked more than a year ago to it, therefore I think that it is
better you have yourself a look at it.

(Without that searchword "nested" it is impossible to find)

I hope this helps,

Cor
Dec 6 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ann Morris | last post by:
INTRODUCTION One of the most powerful aspects of .NET and Windows Forms is data binding. Data binding is the process of associating user interface (UI) elements with a data source to generate a...
16
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
18
by: Mike MacSween | last post by:
I have an app I need a hierachical structure for. There seem to be 3 ways of implementing this, as far as I can see: 1. Adjacency list. Pros - intuitive and relatively simple Cons - not easily...
0
by: NicK chlam via DotNetMonster.com | last post by:
this is the error i get System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.Common.DbDataAdapter.Update(DataRow dataRows, DataTableMapping tableMapping) at...
1
by: thf | last post by:
Hi, I wish to know how to display a collection of object which is a property in another object in a data grid in VB.Net. For example, I'm displaying a collection of vendor objects (in ArrayList)...
0
by: mjsterz | last post by:
I've been working with VB .NET for less than a year and this is the first time I've posted on one of these groups, so let me apologize beforehand if I'm being unclear, not posting my issue...
8
by: Jon Vaughan | last post by:
I have a hierachical dataset brought back from a sql server stored procedure with a design as follows : StaffID <Staff Columns> AddressID <Address Columns> StaffID_FK
14
by: Rolf Welskes | last post by:
Hello, I have an ObjectDataSource which has as business-object a simple array of strings. No problem. I have an own (custom) control to which I give the DataSourceId and in the custom-control...
9
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.