By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,357 Members | 1,021 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,357 IT Pros & Developers. It's quick & easy.

Problem with DataSet ReadXml

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.