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

DataSet.ReadXml

I'm attempting to use ReadXml. It's working in that I end up with some
data in the DataSet. But I'm not able to deal with it effectively after
that. The XML file is properly formatted in that it was created with
WriteXML, so it contains the name of the table (I've inspected it to be
sure). But after calling ReadXml the DataSet does not contain a table
with the specified name. In fact, Tables does not contain a table
corresponding to the data read with ReadXml. I know that the ReadXml is
working because I can view the data in a grid.

The line of code that this thing is choking on is:

cKey[0] = Tables["Changes"].Columns["TableName"];

At this point it tells me that Tables["Changes"] doesn't exist --
returning null.

How can I control the name of the table created when ReadXml is called
or put the data from the XML file into the previously created table that
I would like it to go in?
Nov 28 '05 #1
2 4784
Hi,

You might want to try to write out the schema as well with WriteXML, so
that ReadXML does not need to guess at the schema, but has it already
available.

-Lenard
C Glenn wrote:
I'm attempting to use ReadXml. It's working in that I end up with some
data in the DataSet. But I'm not able to deal with it effectively after
that. The XML file is properly formatted in that it was created with
WriteXML, so it contains the name of the table (I've inspected it to be
sure). But after calling ReadXml the DataSet does not contain a table
with the specified name. In fact, Tables does not contain a table
corresponding to the data read with ReadXml. I know that the ReadXml is
working because I can view the data in a grid.

The line of code that this thing is choking on is:

cKey[0] = Tables["Changes"].Columns["TableName"];

At this point it tells me that Tables["Changes"] doesn't exist --
returning null.

How can I control the name of the table created when ReadXml is called
or put the data from the XML file into the previously created table that
I would like it to go in?

Nov 29 '05 #2
How did you save the DataSet in the first place? Did you save the schema?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition

"C Glenn" <no****@domain.com> wrote in message
news:uQ**************@TK2MSFTNGP10.phx.gbl...
I'm attempting to use ReadXml. It's working in that I end up with some
data in the DataSet. But I'm not able to deal with it effectively after
that. The XML file is properly formatted in that it was created with
WriteXML, so it contains the name of the table (I've inspected it to be
sure). But after calling ReadXml the DataSet does not contain a table
with the specified name. In fact, Tables does not contain a table
corresponding to the data read with ReadXml. I know that the ReadXml is
working because I can view the data in a grid.

The line of code that this thing is choking on is:

cKey[0] = Tables["Changes"].Columns["TableName"];

At this point it tells me that Tables["Changes"] doesn't exist --
returning null.

How can I control the name of the table created when ReadXml is called or
put the data from the XML file into the previously created table that I
would like it to go in?

Nov 29 '05 #3

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

Similar topics

1
by: Jeffrey A. Voigt | last post by:
I'm having trouble loading some xml data into a dataset via the ReadXML call. I'm loading into the dataset an xml schema prior to the ReadXML call. I see that there IS in fact, 3 records that...
1
by: mr_dom_is | last post by:
Hi I have a little bit of trouble, probably missing the point now sure but: I have a dataset dim ds as new dataset("User") Which is populated with data from a database. When I use
8
by: Nikhilesh Mehendale | last post by:
I have written a web service in C#, .NET 1.1 which reads a XML file into a dataset. This is just a plain XML file. First I use the Dataset.ReadXmlScheme function and pass the XML file to it. Then...
1
by: kids_pro | last post by:
I had come across a code block from Loading a DataSet from XML (.NET Framework Developer's Guide) ---------------------------------------- NOte If you call ReadXML to load a very large file, you...
0
by: mr_dom_is | last post by:
Hi I have a little bit of trouble, probably missing the point not sure but: I have a dataset dim ds as new dataset("User") Which is populated with data from a database. When I use
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
12
by: Marc | last post by:
I have used XMLDataToString = DataSetForXML.GetXml() to get an XML string from a dataset. I am looking for a way to create a dataset from this XML string. I tried...
3
by: P K | last post by:
Hello, I have a dataset which is already loaded with data in one table. so dataset.tables("data") exists and has data. Now, I have to add another table to the dataset. The source for this...
11
by: MurdockSE | last post by:
Greetings. My Situation: // I have an .xml file that I am reading into a dataset in the following code - DataSet ds = new DataSet("MyDataset"); ds.ReadXml(@"c:\data\"+cmyxmlfilename);
1
by: Mac | last post by:
I'm trying to validate input from an xml source to a dataset in dotnet2.0. As far as I can see, type errors correctly cause an exception, but values that are the correct type but do not satisify...
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
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
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
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...

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.