473,763 Members | 6,149 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with DataSet ReadXml

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 the exception ONLY in Web Sites:

{"The type initializer for 'System.Xml.Sch ema.DatatypeImp lementation' threw
an exception."}

Inner Exception Message:
"The type initializer for 'System.Xml.Sch ema.Datatype_lo ng' threw an
exception."
Inner Inner Exception Message
{"Field token out of range."}

Stack Trace

at System.Xml.Sche ma.Compiler.Com pile()
at System.Xml.Sche ma.XmlSchema.Co mpileSchemaInSe t(XmlNameTable nameTable,
ValidationEvent Handler eventHandler, XmlSchemaCompil ationSettings
compilationSett ings)
at System.Xml.Sche ma.Preprocessor .GetBuildInSche ma()
at System.Xml.Sche ma.Preprocessor .Cleanup(XmlSch ema schema)
at System.Xml.Sche ma.Preprocessor .Preprocess(Xml Schema schema, String
targetNamespace , ArrayList imports)
at System.Xml.Sche ma.Preprocessor .Execute(XmlSch ema schema, String
targetNamespace , Boolean loadExternals)
at System.Xml.Sche ma.XmlSchemaSet .PreprocessSche ma(XmlSchema& schema,
String targetNamespace )
at System.Xml.Sche ma.XmlSchemaSet .Add(String targetNamespace , XmlSchema
schema)
at System.Xml.Sche ma.XmlSchemaSet .Add(XmlSchema schema)
at System.Xml.Sche ma.XmlSchemaInf erence.CreateXm lSchema(String targetNS)
at System.Xml.Sche ma.XmlSchemaInf erence.AddEleme nt(String localName,
String prefix, String childURI, XmlSchema parentSchema,
XmlSchemaObject Collection addLocation, Int32 positionWithinC ollection)
at System.Xml.Sche ma.XmlSchemaInf erence.InferSch ema1(XmlReader
instanceDocumen t, XmlSchemaSet schemas)
at System.Xml.Sche ma.XmlSchemaInf erence.InferSch ema(XmlReader
instanceDocumen t)
at System.Data.Dat aSet.InferSchem a(XmlDocument xdoc, String[]
excludedNamespa ces, XmlReadMode mode)
at System.Data.Dat aSet.ReadXml(Xm lReader reader, Boolean denyResolving)
at System.Data.Dat aSet.ReadXml(St ring fileName)
at ClassLibrary1.C lass1.GetDataSe t() in
C:\ajlopez\Prue basPuntoNet2\Cl assLibrary1\Cla ss1.vb:line 6
at _Default.Page_L oad(Object sender, EventArgs e) in
C:\ajlopez\Prue basPuntoNet2\We bSite2\Default. aspx.vb:line 14
at System.Web.UI.C ontrol.OnLoad(E ventArgs e)
at System.Web.UI.C ontrol.LoadRecu rsive()
at System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)

In console applications, the same instruction, with the same data, runs OK.

The same application, runs from VS ok, in other machines, and in my Virtual
Machines.

Why? Any clue?

TIA

Angel "Java" Lopez
http://www.ajlopez.com/

Dec 19 '06 #1
1 3823
Angel "Java" Lopez..
Can you post your XML data and some snippet code
Patrick

"Angel "Java" Lopez" <we*******@ajlo pez.comwrote in message
news:uy******** ******@TK2MSFTN GP02.phx.gbl...
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 the exception ONLY in Web Sites:

{"The type initializer for 'System.Xml.Sch ema.DatatypeImp lementation'
threw
an exception."}

Inner Exception Message:
"The type initializer for 'System.Xml.Sch ema.Datatype_lo ng' threw an
exception."
Inner Inner Exception Message
{"Field token out of range."}

Stack Trace

at System.Xml.Sche ma.Compiler.Com pile()
at System.Xml.Sche ma.XmlSchema.Co mpileSchemaInSe t(XmlNameTable
nameTable,
ValidationEvent Handler eventHandler, XmlSchemaCompil ationSettings
compilationSett ings)
at System.Xml.Sche ma.Preprocessor .GetBuildInSche ma()
at System.Xml.Sche ma.Preprocessor .Cleanup(XmlSch ema schema)
at System.Xml.Sche ma.Preprocessor .Preprocess(Xml Schema schema, String
targetNamespace , ArrayList imports)
at System.Xml.Sche ma.Preprocessor .Execute(XmlSch ema schema, String
targetNamespace , Boolean loadExternals)
at System.Xml.Sche ma.XmlSchemaSet .PreprocessSche ma(XmlSchema& schema,
String targetNamespace )
at System.Xml.Sche ma.XmlSchemaSet .Add(String targetNamespace , XmlSchema
schema)
at System.Xml.Sche ma.XmlSchemaSet .Add(XmlSchema schema)
at System.Xml.Sche ma.XmlSchemaInf erence.CreateXm lSchema(String
targetNS)
at System.Xml.Sche ma.XmlSchemaInf erence.AddEleme nt(String localName,
String prefix, String childURI, XmlSchema parentSchema,
XmlSchemaObject Collection addLocation, Int32 positionWithinC ollection)
at System.Xml.Sche ma.XmlSchemaInf erence.InferSch ema1(XmlReader
instanceDocumen t, XmlSchemaSet schemas)
at System.Xml.Sche ma.XmlSchemaInf erence.InferSch ema(XmlReader
instanceDocumen t)
at System.Data.Dat aSet.InferSchem a(XmlDocument xdoc, String[]
excludedNamespa ces, XmlReadMode mode)
at System.Data.Dat aSet.ReadXml(Xm lReader reader, Boolean denyResolving)
at System.Data.Dat aSet.ReadXml(St ring fileName)
at ClassLibrary1.C lass1.GetDataSe t() in
C:\ajlopez\Prue basPuntoNet2\Cl assLibrary1\Cla ss1.vb:line 6
at _Default.Page_L oad(Object sender, EventArgs e) in
C:\ajlopez\Prue basPuntoNet2\We bSite2\Default. aspx.vb:line 14
at System.Web.UI.C ontrol.OnLoad(E ventArgs e)
at System.Web.UI.C ontrol.LoadRecu rsive()
at System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)

In console applications, the same instruction, with the same data, runs
OK.
>
The same application, runs from VS ok, in other machines, and in my
Virtual
Machines.

Why? Any clue?

TIA

Angel "Java" Lopez
http://www.ajlopez.com/

Dec 28 '06 #2

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

Similar topics

1
4831
by: Jeffrey A. Voigt | last post by:
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 ? IS there something I'm missing? I can assure you that the schema is correct, since it was originally created with...
1
5821
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
8
5686
by: Nikhilesh Mehendale | last post by:
I have written a web service in C#, .NET 1.1 which reads a XML file into a dataset. This is just a plain XML file. First I use the Dataset.ReadXmlScheme function and pass the XML file to it. Then I convert data type of one of the column to integer and then I use the Dataset.ReadXml function and pass the same file to it. This works on my machine, but when I run it on a .NET 2.0 machine it thows an exception with message "Input string was...
2
1819
by: bfrasca | last post by:
I have a well-formed XML file that I am trying to load into a dataset using the ReadXML method. It keeps telling me that "there are multiple root elements". I can view the data using XML Designer in Visual Studio 2003 without any problems and the schema and file have been validated using several different tools. I even successfully generated a typed dataset with Visual Studio 2003 by importing the XML into my project. I'm baffled, does...
2
2119
by: mathieu cupryk | last post by:
I have problems with listboxes in the webform2.cs, the textboxes are working well when I do a click on next. I am missing something. It works with the textboxes. Here is the file: using System; using System.Collections; using System.Collections.Specialized; using System.ComponentModel; using System.Data; using System.Drawing;
1
3156
by: kids_pro | last post by:
I had come across a code block from Loading a DataSet from XML (.NET Framework Developer's Guide) ---------------------------------------- NOte If you call ReadXML to load a very large file, you may encounter slow performance. To ensure best performance for ReadXml, on a large file, call the DataTable.BeginLoadData method for each table in the DataSet, then call ReadXml. Finally, call DataTable.EndLoadData for each table in the DataSet as...
0
1476
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
12
23770
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 DataSetForXML.ReadXml(XMLDataToString) but I received error messages. Does anyone know how to do this without creating a file (disk copy) of this XML data? Thanks for your help. Marc
8
2377
by: Thirsty Traveler | last post by:
I have a dataset that is returned from a sql server select that contains metadata and a cached dataset saved in an xml column. I would like to recover the dataset for use in generating a crystal pdf file. the rptds.ReadXml method can accept either a string file indicating a filename or a stream. the row.ToString() is the saved dataset. If I use this directly it throws an error because it is data and not a filename. I have a workaround seen...
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10144
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9997
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9937
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.