473,396 Members | 2,018 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,396 software developers and data experts.

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.Schema.DatatypeImplementation' threw
an exception."}

Inner Exception Message:
"The type initializer for 'System.Xml.Schema.Datatype_long' threw an
exception."
Inner Inner Exception Message
{"Field token out of range."}

Stack Trace

at System.Xml.Schema.Compiler.Compile()
at System.Xml.Schema.XmlSchema.CompileSchemaInSet(Xml NameTable nameTable,
ValidationEventHandler eventHandler, XmlSchemaCompilationSettings
compilationSettings)
at System.Xml.Schema.Preprocessor.GetBuildInSchema()
at System.Xml.Schema.Preprocessor.Cleanup(XmlSchema schema)
at System.Xml.Schema.Preprocessor.Preprocess(XmlSchem a schema, String
targetNamespace, ArrayList imports)
at System.Xml.Schema.Preprocessor.Execute(XmlSchema schema, String
targetNamespace, Boolean loadExternals)
at System.Xml.Schema.XmlSchemaSet.PreprocessSchema(Xm lSchema& schema,
String targetNamespace)
at System.Xml.Schema.XmlSchemaSet.Add(String targetNamespace, XmlSchema
schema)
at System.Xml.Schema.XmlSchemaSet.Add(XmlSchema schema)
at System.Xml.Schema.XmlSchemaInference.CreateXmlSche ma(String targetNS)
at System.Xml.Schema.XmlSchemaInference.AddElement(St ring localName,
String prefix, String childURI, XmlSchema parentSchema,
XmlSchemaObjectCollection addLocation, Int32 positionWithinCollection)
at System.Xml.Schema.XmlSchemaInference.InferSchema1( XmlReader
instanceDocument, XmlSchemaSet schemas)
at System.Xml.Schema.XmlSchemaInference.InferSchema(X mlReader
instanceDocument)
at System.Data.DataSet.InferSchema(XmlDocument xdoc, String[]
excludedNamespaces, XmlReadMode mode)
at System.Data.DataSet.ReadXml(XmlReader reader, Boolean denyResolving)
at System.Data.DataSet.ReadXml(String fileName)
at ClassLibrary1.Class1.GetDataSet() in
C:\ajlopez\PruebasPuntoNet2\ClassLibrary1\Class1.v b:line 6
at _Default.Page_Load(Object sender, EventArgs e) in
C:\ajlopez\PruebasPuntoNet2\WebSite2\Default.aspx. vb:line 14
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

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 3799
Angel "Java" Lopez..
Can you post your XML data and some snippet code
Patrick

"Angel "Java" Lopez" <we*******@ajlopez.comwrote in message
news:uy**************@TK2MSFTNGP02.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.Schema.DatatypeImplementation'
threw
an exception."}

Inner Exception Message:
"The type initializer for 'System.Xml.Schema.Datatype_long' threw an
exception."
Inner Inner Exception Message
{"Field token out of range."}

Stack Trace

at System.Xml.Schema.Compiler.Compile()
at System.Xml.Schema.XmlSchema.CompileSchemaInSet(Xml NameTable
nameTable,
ValidationEventHandler eventHandler, XmlSchemaCompilationSettings
compilationSettings)
at System.Xml.Schema.Preprocessor.GetBuildInSchema()
at System.Xml.Schema.Preprocessor.Cleanup(XmlSchema schema)
at System.Xml.Schema.Preprocessor.Preprocess(XmlSchem a schema, String
targetNamespace, ArrayList imports)
at System.Xml.Schema.Preprocessor.Execute(XmlSchema schema, String
targetNamespace, Boolean loadExternals)
at System.Xml.Schema.XmlSchemaSet.PreprocessSchema(Xm lSchema& schema,
String targetNamespace)
at System.Xml.Schema.XmlSchemaSet.Add(String targetNamespace, XmlSchema
schema)
at System.Xml.Schema.XmlSchemaSet.Add(XmlSchema schema)
at System.Xml.Schema.XmlSchemaInference.CreateXmlSche ma(String
targetNS)
at System.Xml.Schema.XmlSchemaInference.AddElement(St ring localName,
String prefix, String childURI, XmlSchema parentSchema,
XmlSchemaObjectCollection addLocation, Int32 positionWithinCollection)
at System.Xml.Schema.XmlSchemaInference.InferSchema1( XmlReader
instanceDocument, XmlSchemaSet schemas)
at System.Xml.Schema.XmlSchemaInference.InferSchema(X mlReader
instanceDocument)
at System.Data.DataSet.InferSchema(XmlDocument xdoc, String[]
excludedNamespaces, XmlReadMode mode)
at System.Data.DataSet.ReadXml(XmlReader reader, Boolean denyResolving)
at System.Data.DataSet.ReadXml(String fileName)
at ClassLibrary1.Class1.GetDataSet() in
C:\ajlopez\PruebasPuntoNet2\ClassLibrary1\Class1.v b:line 6
at _Default.Page_Load(Object sender, EventArgs e) in
C:\ajlopez\PruebasPuntoNet2\WebSite2\Default.aspx. vb:line 14
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

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
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...
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
8
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...
2
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...
2
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;...
1
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...
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
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...
8
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...
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: 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...
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...
0
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...
0
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.