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

Problem with DataSet.ReadXML with valid Schema

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 should be created in the dataset
with the provided xml. However, after the ReadXML statement there are no
rows in the DataSet.Tables[0] ? IS there something I'm missing? I can
assure you that the schema is correct, since it was originally created with
the data using the DataSet.WriteXMLSchema method.

here is the example code I'm using:

// call the web service and get the returned xml

xmlOutput = webService.TodaysEvents( "", ipAddress, "", "", "", "", "", "",
"", "", "", "" );

// read in the xml

xmlStringReader = new System.IO.StringReader( xmlOutput );

// create the dataset

data = new DataSet();

// set the schema to check against

data.ReadXmlSchema( Server.MapPath(
"outputSchemas/OLITSBroadcastTodaysEvents.xsd" ) );

// convert the data into a dataset

data.ReadXml( xmlStringReader );

Thanks,
Nov 12 '05 #1
1 4760
It's hard to say what's going wrong without the relevant sections from
schema file and the data beeing loaded. Will it be possible to post them ?

--
Daniel D.C. [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights

"Jeffrey A. Voigt" <vo***********@myfloridahouse.com> wrote in message
news:uT**************@TK2MSFTNGP12.phx.gbl...
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 should be created in the dataset with the provided xml. However, after the ReadXML statement there are no
rows in the DataSet.Tables[0] ? IS there something I'm missing? I can
assure you that the schema is correct, since it was originally created with the data using the DataSet.WriteXMLSchema method.

here is the example code I'm using:

// call the web service and get the returned xml

xmlOutput = webService.TodaysEvents( "", ipAddress, "", "", "", "", "", "", "", "", "", "" );

// read in the xml

xmlStringReader = new System.IO.StringReader( xmlOutput );

// create the dataset

data = new DataSet();

// set the schema to check against

data.ReadXmlSchema( Server.MapPath(
"outputSchemas/OLITSBroadcastTodaysEvents.xsd" ) );

// convert the data into a dataset

data.ReadXml( xmlStringReader );

Thanks,

Nov 12 '05 #2

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

Similar topics

0
by: Derek Andrew | last post by:
I have a typed dataset that was created with xsd tool from a schema. When I try to load an xml file into the dataset I get a constraint error. The error is cause by the very first attribute on the...
0
by: Kurt | last post by:
Hi, (sorry if I'm cross posting - not quite sure where to put) I am basically trying to force the user of my web service to only send a valid dataset that is based on a schema I have created. ...
7
by: Sharon | last post by:
I have successfully loaded a DataSet object with a XML schema (XSD). Now I wish to populate the tables that was created in the DataSet. I have an XML file/string that contain all the needed data...
2
by: MarkAurit | last post by:
How does one go about getting the information from an .xsd file into a WSDL document? I have a web service that creates a simple object that IBM Websphere can see and use. Great. However, when I...
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...
0
by: Matt | last post by:
I have a problem when I select node elements from an xml file and validata each node againts the schema. I use XmlValidatingReader and it complains about elements not being declared. I have...
1
by: Angel \Java\ Lopez | last post by:
Hi people! I'm running a Visual Studio 2005, Professional, on Windows XP Professional. I've found a little big problem, reading a DataSet. If I try: ds.ReadXml("c:\data.xml") it raises...
4
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
I've got a DataSet that I save as XML using the DataSet DataTable's WriteXml method. If I say XmlWriteMode.IgnoreSchema, it shows up great in Excel, but I can not reopen the file in my...
9
muaddubby
by: muaddubby | last post by:
Hi I'm running into a scenario with a DataSet that has a schema loaded into it, tries to then load data (that matches the schema), and fails with a "Input string was not in a correct format"...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.