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

Dataset getXML and ReadXML

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

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)

I am using :

Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032

Am I doing something wrong?

Nov 19 '05 #1
0 1458

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...
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.