473,505 Members | 15,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Put a DataTable at the beginning of a DataSet

Hi,

I have a DataSet, which contains several DataTables. I want to put a new
DataTable in it (tblFileSettings) just before I write this DataSet to an
XML-file.

But what I want is that this new DataTable tblFileSettings is the first
DataTable in the XML-file. So If uses open the XML file, they see this
DataTable (which contains some info about the file).

Does anybody knows how to do this? The problem is that I can't insert this
DataTable before I insert all the others, because of the fact that the data
in my tblFileSettings depends on the other DataTables...

Any help would be really appreciated!!

Tanksa lot,

Pieter
Jul 22 '05 #1
5 1220
Hi,

I dont see anyway to control where a datatable is added to a
dataset. Maybe you could create a 2nd dataset and add the tables to it in
the order you want.

Ken
-----------------
"DraguVaso" <pi**********@hotmail.com> wrote in message
news:eq*************@TK2MSFTNGP15.phx.gbl...
Hi,

I have a DataSet, which contains several DataTables. I want to put a new
DataTable in it (tblFileSettings) just before I write this DataSet to an
XML-file.

But what I want is that this new DataTable tblFileSettings is the first
DataTable in the XML-file. So If uses open the XML file, they see this
DataTable (which contains some info about the file).

Does anybody knows how to do this? The problem is that I can't insert this
DataTable before I insert all the others, because of the fact that the data
in my tblFileSettings depends on the other DataTables...

Any help would be really appreciated!!

Tanksa lot,

Pieter

Jul 22 '05 #2
Or write dataset's xml to a stream and modify it "manually".

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hi,

I dont see anyway to control where a datatable is added to a
dataset. Maybe you could create a 2nd dataset and add the tables to it in
the order you want.

Ken
-----------------
"DraguVaso" <pi**********@hotmail.com> wrote in message
news:eq*************@TK2MSFTNGP15.phx.gbl...
Hi,

I have a DataSet, which contains several DataTables. I want to put a new
DataTable in it (tblFileSettings) just before I write this DataSet to an
XML-file.

But what I want is that this new DataTable tblFileSettings is the first
DataTable in the XML-file. So If uses open the XML file, they see this
DataTable (which contains some info about the file).

Does anybody knows how to do this? The problem is that I can't insert this
DataTable before I insert all the others, because of the fact that the
data
in my tblFileSettings depends on the other DataTables...

Any help would be really appreciated!!

Tanksa lot,

Pieter

Jul 22 '05 #3
How about creating a new DataSet and assembling it in the order in which you
wish the data to appear?

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"DraguVaso" <pi**********@hotmail.com> wrote in message
news:eq*************@TK2MSFTNGP15.phx.gbl...
Hi,

I have a DataSet, which contains several DataTables. I want to put a new
DataTable in it (tblFileSettings) just before I write this DataSet to an
XML-file.

But what I want is that this new DataTable tblFileSettings is the first
DataTable in the XML-file. So If uses open the XML file, they see this
DataTable (which contains some info about the file).

Does anybody knows how to do this? The problem is that I can't insert this
DataTable before I insert all the others, because of the fact that the
data
in my tblFileSettings depends on the other DataTables...

Any help would be really appreciated!!

Tanksa lot,

Pieter

Jul 22 '05 #4
What about exporting each table to xml individually? You can set up the xml
the way that you like it too :)
"DraguVaso" wrote:
Hi,

I have a DataSet, which contains several DataTables. I want to put a new
DataTable in it (tblFileSettings) just before I write this DataSet to an
XML-file.

But what I want is that this new DataTable tblFileSettings is the first
DataTable in the XML-file. So If uses open the XML file, they see this
DataTable (which contains some info about the file).

Does anybody knows how to do this? The problem is that I can't insert this
DataTable before I insert all the others, because of the fact that the data
in my tblFileSettings depends on the other DataTables...

Any help would be really appreciated!!

Tanksa lot,

Pieter

Jul 22 '05 #5
ok, thanks for the answers! :-)

"DraguVaso" <pi**********@hotmail.com> wrote in message
news:eq*************@TK2MSFTNGP15.phx.gbl...
Hi,

I have a DataSet, which contains several DataTables. I want to put a new
DataTable in it (tblFileSettings) just before I write this DataSet to an
XML-file.

But what I want is that this new DataTable tblFileSettings is the first
DataTable in the XML-file. So If uses open the XML file, they see this
DataTable (which contains some info about the file).

Does anybody knows how to do this? The problem is that I can't insert this
DataTable before I insert all the others, because of the fact that the data in my tblFileSettings depends on the other DataTables...

Any help would be really appreciated!!

Tanksa lot,

Pieter

Jul 22 '05 #6

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

Similar topics

2
5045
by: Carl Lindmark | last post by:
Hello, I am having trouble understanding how to navigate a DataSet table... - maybe someone can steer me in the right direction? Say you've read an XML document into a DataSet ("myDataSet")...
0
3127
by: Chris Ericoli | last post by:
Hi, I am working with an 'in session' ado dataset with an asp.net application. My dataset is comprised of two tables, one of which maintains a few calculated datacolumns. For some reason these...
3
3177
by: Jon | last post by:
I'm learning about datatables. When using the example provided by MS in the ..NET Framework Class Library for DATATABLE (see below) I get an error on line 3 that says "Type expected". Is something...
5
1109
by: DraguVaso | last post by:
Hi, I have a DataSet, which contains several DataTables. I want to put a new DataTable in it (tblFileSettings) just before I write this DataSet to an XML-file. But what I want is that this...
3
6976
by: stockblaster | last post by:
Hello all.. Is it possible to convert a DataTable (i create the DataTable from a CSV file) into binary data and save it into an sql 2005 table (into binary field). After that I want to...
10
6499
by: dauphian | last post by:
Hello, I am new to .net and am trying to build a report application that queries 4 different tables based on a id, and I need to return them in the same table for easy viewing. Basically, I...
9
3991
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...
5
3741
by: =?Utf-8?B?SnVsaWEgQg==?= | last post by:
Hi, I wonder if anyone can help? I've got a web form (intranet), .net version 1.1. I've got a sub that populates a datatable in a dataset, dependent on a dropdown field selection. This works...
0
2834
by: =?Utf-8?B?cm9uZSBtYXRpYXM=?= | last post by:
I have the same task to do but everytime I tried to parse my code I get a null value returned after executing "dtMaterials.WriteXml(swMaterials);". I am using the following code: Hope you can hep...
0
7098
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
7303
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,...
0
7367
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...
1
7018
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...
0
5613
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1528
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
407
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.