471,354 Members | 1,397 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 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 4648
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jeffrey A. Voigt | last post: by
1 post views Thread by mr_dom_is | last post: by
1 post views Thread by kids_pro | last post: by
reply views Thread by mr_dom_is | last post: by
22 posts views Thread by Arne | last post: by
12 posts views Thread by Marc | last post: by
3 posts views Thread by P K | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.