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

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
Nov 21 '05 #1
5 1101
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

Nov 21 '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

Nov 21 '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

Nov 21 '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

Nov 21 '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

Nov 21 '05 #6

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

Similar topics

5
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...
2
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
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
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...
3
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
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...
3
by: Tom | last post by:
I have a dataTable being returned from my datalayet, I need to convert it to a dataSet so I can do some data manipulation to it prior to populating my datagrid. How can I convert the datatable to a...
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...
5
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
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
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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:
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,...
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...

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.