473,324 Members | 2,196 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,324 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 5799
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: DotNetJunkies User | last post by:
Hi all, I have a question on how can I write the entire Dataset to a NTEXT field of SQLServer. Can anyone help me? Thanks! /mike
1
by: Andy | last post by:
Hello, I have a WebService that sends a client a DataSet as XML (I use a DataSet.GetXml to get the XML). The DataSet is filled by a DataAdapter in the WebService. The client coverts the XML Back...
0
by: thomas | last post by:
I must be doing something obvious wrong here, but: I perform a query to retrieve a dataset - I want to archive this in a SQL field for seperate retrieval later, while the original data may have...
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...
3
by: Gene Vangampelaere | last post by:
Hi, I'm having a frustrating problem :) I have an XML like this : <?xml version="1.0" encoding="utf-8"?> <cgb> <parameters> <parameter> <paramName>patientNr</paramName>
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: Greg Collins [Microsoft MVP] | last post by:
I have a SQL2005 XML column I load into a DataSet. I then bind to a DataGrid. If I set an asp:Literal text value to the DataSet.GetXml() when I first load it into the DataSet, it displays...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.