472,145 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

Dataset GetXML and ReadXML

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

strXml = ds.GetXml()
strSchema = ds.GetSchema()

Then try and re-import into a data set, using the following
mXml = New
MemoryStream(Encoding.GetEncoding("UTF-16").GetBytes(strXml))
mSchema = New
MemoryStream(Encoding.GetEncoding("UTF-16").GetBytes(strSchema))

dim importDS as new DataSet("User")

importDS.ReadSchema(mschema)

importDS.ReadXml(mXml)

I find that the schema imports correctly however the the ReadXML line
throws and exception, checking the XML I can't see anything wrong with
it, as it just a direct output from getXML
[XmlException: An unexpected end of file parsing NAME has occurred.
Line 1, position 2.]
System.Xml.XmlScanner.ScanMarkup() +1360
System.Xml.XmlTextReader.ParseTag() +74
System.Xml.XmlTextReader.ParseRoot() +234
System.Xml.XmlTextReader.Read() +127
System.Xml.XmlReader.MoveToContent() +75
System.Data.DataSet.ReadXml(XmlReader reader, Boolean denyResolving)
System.Data.DataSet.ReadXml(Stream stream)

Nov 12 '05 #1
1 5735
Thought I should mention I am using

Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032
mr_dom...@hotmail.com wrote:
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

strXml = ds.GetXml()
strSchema = ds.GetSchema()

Then try and re-import into a data set, using the following
mXml = New
MemoryStream(Encoding.GetEncoding("UTF-16").GetBytes(strXml))
mSchema = New
MemoryStream(Encoding.GetEncoding("UTF-16").GetBytes(strSchema))

dim importDS as new DataSet("User")

importDS.ReadSchema(mschema)

importDS.ReadXml(mXml)

I find that the schema imports correctly however the the ReadXML line
throws and exception, checking the XML I can't see anything wrong with
it, as it just a direct output from getXML
[XmlException: An unexpected end of file parsing NAME has occurred.
Line 1, position 2.]
System.Xml.XmlScanner.ScanMarkup() +1360
System.Xml.XmlTextReader.ParseTag() +74
System.Xml.XmlTextReader.ParseRoot() +234
System.Xml.XmlTextReader.Read() +127
System.Xml.XmlReader.MoveToContent() +75
System.Data.DataSet.ReadXml(XmlReader reader, Boolean denyResolving)
System.Data.DataSet.ReadXml(Stream stream)


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by DotNetJunkies User | last post: by
reply views Thread by thomas | last post: by
reply views Thread by mr_dom_is | last post: by
22 posts views Thread by Arne | last post: by
3 posts views Thread by Gene Vangampelaere | last post: by
12 posts views Thread by Marc | last post: by
3 posts views Thread by Greg Collins [Microsoft MVP] | last post: by
reply views Thread by leo001 | 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.