473,486 Members | 1,970 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

xml file to datatable

I have a XML file that is generated by the user. I need to take that XML and
either create a dataset and read the XML to populate some labels on my form.
I can I read the XML and put that into a datatable and populate the labels
on my form?

thx
Nov 21 '05 #1
4 7452
Hi,

The dataset has a readxml method that will put the data in a
datatable located inside a dataset.

http://msdn.microsoft.com/library/de...adXmlTopic.asp

Ken
-----------------------------
"Mike" <me@me.com> wrote in message
news:Oq**************@TK2MSFTNGP12.phx.gbl...
I have a XML file that is generated by the user. I need to take that XML and
either create a dataset and read the XML to populate some labels on my form.
I can I read the XML and put that into a datatable and populate the labels
on my form?

thx

Nov 21 '05 #2
Hi Mike,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to read data in an XML file to
a DataSet and bind some label controls to the DataSet. If there is any
misunderstanding, please feel free to let me know.

As far as I know, this depends on how the Xml file is generated. If it is
exported with DataSet.WriteXml, we can simply use DataSet.ReadXml to read
this to the DataSet. However, if it is an xml file which doesn't meet the
DataSet format, I think we have to make some changes to it or use an
XmlDocument to read data and add it to DataSet row by row.

When the DataSet is populated, we can use data binding to show the data in
the DataSet on label controls. Suppose we have a DataSet ds, a label
label1, the table name is Table1, we can use the following to show FistName
field on label1.

this.label1.DataBindings.Add("Text", ds, "Table1.FirstName");

For more information, please check:

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemdatadatasetclassreadxmltopic2.asp

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 21 '05 #3
Mike,

In addition to Kevin, a XML dataset as file has this header
<?xml version="1.0" standalone="yes" ?>

And is mostly direct to recognize because it contains no attributes however
only elements.

Cor
Nov 21 '05 #4
Hi Mike,

I'd like to know if this issue has been resolved yet. Is there anything
that I can help. I'm still monitoring on it. If you have any questions,
please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 21 '05 #5

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

Similar topics

3
10065
by: DapperDanH | last post by:
I want to make a class that basically looks at the clipboard, and for the standard types of clipboard objects (csv,text, etc), create a DataTable from it. Not all formats will be supported but as...
2
1753
by: DraguVaso | last post by:
Hi, I need a FAST way to put the content of a file in a datatable (one record for each line in the file). I have a routine for it, but it takes me too much time (2-5 seconds for each file) to...
0
2532
by: troutbum | last post by:
I am experiencing problems when one user has a document open through a share pointing to the web site. I use the dsolefile to read the contents of a particular directory and then display them in a...
1
2039
by: BobLaughland | last post by:
What is the best way to import the contents of a CSV file into C# objects? E.G. a CSV file that looks like this a1,b1,c1,d1, a2,b2,c2,d2, a3,b3,c3,d3 Would be loaded up and then turned...
4
12763
by: Amit Maheshwari | last post by:
I need to read text file having data either comma seperated or tab seperated or any custom seperator and convert into a DataSet in C# . I tried Microsoft Text Driver and Microsoft.Jet.OLEDB.4.0...
0
2172
by: Anish G | last post by:
Hi, I have an issue with reading CSV files. I am to reading CSV file and putting it in a Datatable in C#. I am using a regular expression to read the values. Below is the code. Now, it reads...
13
2779
by: JJ | last post by:
I have a need to input a large tab delimited text file, which I will parse to check it has the expected columns, before allowing the user to submit it to the database. The user may paste the file...
4
3497
by: =?Utf-8?B?TWlrZSBE?= | last post by:
I read the CSV file into a DataTable. This is so I can fix invalid dates and other data I don't want in the database. Then I use SqlBulkCopy to insert the data into the SQL database. All the...
2
3017
by: chike_oji | last post by:
Please can someone help me. I am writing a web application, that allows for the upload of an excel sheet into the database. I have an upload button and a save button. The upload button allows...
1
1995
by: mbewers1 | last post by:
Hi, I'm getting the following error when executing the SQL within this line of code. Originally, I had coded a stored procedure within the code but this brought up the same error. I've looked...
0
7099
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
6964
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
7123
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
7175
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
7319
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3069
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1378
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 ...
0
262
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.