473,395 Members | 1,623 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,395 software developers and data experts.

How to rearrange datacolumns in a dataset from related datatables

11
Hi

I have 3 tables related by some keys. I add these three tables to a dataset and finally write to XML file. The XML file is then sent to the client. Since I added the relations, the XML shows proper hierarchy. I am facing an issue that the XML file shows the related data in sequencial order. Ex:
Expand|Select|Wrap|Line Numbers
  1. <table1>
  2.   <table1_col1>col1</table1_col1>
  3.   <table1_col2>col2</table1_col2>
  4.   <table1_col3>col3</table1_col3>
  5.   <table2>
  6.     <table2_col1>col1</table2_col1>
  7.     <table2_col2>col2</table2_col2>
  8.     <table3>
  9.           <table3_col1>col1</table3_col1>
  10.     </table3>
  11.   </table2>
  12. </table1>
But actually, I want to see the output as:
Expand|Select|Wrap|Line Numbers
  1. <table1>
  2.   <table1_col1>col1</table1_col1>
  3.   <table2>
  4.     <table2_col1>col1</table2_col1>
  5.     <table2_col2>col2</table2_col2>
  6.     <table3>
  7.           <table3_col1>col1</table3_col1>
  8.     </table3>
  9.   </table2>
  10.   <table1_col2>col2</table1_col2>
  11.   <table1_col3>col3</table1_col3>
  12. </table1>
I am creating each databale dynamically and add the relations and tables to the dataset. And then call WriteXML to create the output. I am not sure if I can use SetOrdinal to arrange the entire datatable? Please help.
Sep 22 '10 #1
0 1019

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jade | last post by:
Hi, I just wanted to ask a quick question regarding datasets. I am creating 3 tables using a dataadapter. what i want to know is that is the relationship created between these datatables...
1
by: Kyle | last post by:
I am having a major issue with strongly typed datasets. I have been using the Server Explorer in VS.net 2003 to add tables from the database into a DataSet. I cannot access the rows or columns of...
1
by: angela | last post by:
Hi I have two select statements, one pulling out the contacts and one pulling out the primary address of the contact (if there is one) And I would like to populate the dataset or rearrange a...
22
by: EMW | last post by:
Hi, I managed to create a SQL server database and a table in it. The table is empty and that brings me to my next chalenge: How can I get the info in the table in the dataset to go in an empty...
6
by: al | last post by:
Greetings, Thanks in advance for your kind attension. I have been searching for documents about dynamically coding MDI forms when working with datasets. Does anyone know of any??? MTIA,...
0
by: Christopher H. Laco | last post by:
I'm in a strange situation. I have a dataset that uses it own connection string from MySettings. All is well. This thing works in .NET just dandy. If I reference this dataset from another...
1
by: testblog | last post by:
I have a problem whenever i add a new item dataset to a asp.et web site it gives me an error object instance not set to an instance of an object innnstead of showing the tableadapter configuration...
9
by: =?Utf-8?B?RGljaw==?= | last post by:
I have a function that creates a DataSet, populates its many DataTables and then returns the DataSet. I want to bind separate controls to each of the DataSet's DataTables, e.g. a separate...
4
by: =?Utf-8?B?Si5NYXR0aGV3cw==?= | last post by:
Picture the cut down scenario... Say I have three datatables (Person, Address, Street) that are linked with datarelation objects using the PK/FK associations... Person -------- PersonId {PK}...
2
by: Baddy2009 | last post by:
Hi everybody, I have a problem: I have a form and a DataGridView. I used DataAdapter to get data from the DB. My source Db have two tables, and i use the join the create e new tables in the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.