473,748 Members | 2,891 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.Xml.XmlE xception: The root element is missing.

The code is below but I'm 99.9% sure that the code is okay and that maybe the
schema has become corrupt somehow and im not sure how to fix it?
Private Function LoadXMLSchema()
'Dim fileName As String = "C:\Documen ts and
Settings\marc.m cguckian\My Documents\Visua l Studio Projects\MIS RECON
Engine\MISRE_XM LSchema.xsd"
Dim fileName As String =
"F:\QDIMIS_RECO N_Logs\config\M ISRE_XMLSchema. xsd"
If Not File.Exists(fil eName) Then
MessageBox.Show ("The configuration Setup cannot be found, Please
re-install application and try again", "MIS RECON Engine",
MessageBoxButto ns.OK, MessageBoxIcon. Exclamation)
Return -1
End If

Dim fs As FileStream = New FileStream(file Name, FileMode.Open,
FileAccess.Read )
Dim xtr As XmlTextReader = New XmlTextReader(f s)
dsSettings = New DataSet
Try
dsSettings.Read XmlSchema(xtr)
Catch ex As XmlException
MessageBox.Show (ex.ToString)
End Try

xtr.Close()

End Function

Nov 21 '05 #1
1 9423
All I can say is I was lucky to have a backup

"marcmc" wrote:
The code is below but I'm 99.9% sure that the code is okay and that maybe the
schema has become corrupt somehow and im not sure how to fix it?
Private Function LoadXMLSchema()
'Dim fileName As String = "C:\Documen ts and
Settings\marc.m cguckian\My Documents\Visua l Studio Projects\MIS RECON
Engine\MISRE_XM LSchema.xsd"
Dim fileName As String =
"F:\QDIMIS_RECO N_Logs\config\M ISRE_XMLSchema. xsd"
If Not File.Exists(fil eName) Then
MessageBox.Show ("The configuration Setup cannot be found, Please
re-install application and try again", "MIS RECON Engine",
MessageBoxButto ns.OK, MessageBoxIcon. Exclamation)
Return -1
End If

Dim fs As FileStream = New FileStream(file Name, FileMode.Open,
FileAccess.Read )
Dim xtr As XmlTextReader = New XmlTextReader(f s)
dsSettings = New DataSet
Try
dsSettings.Read XmlSchema(xtr)
Catch ex As XmlException
MessageBox.Show (ex.ToString)
End Try

xtr.Close()

End Function

Nov 21 '05 #2

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

Similar topics

7
4240
by: Microsoft News | last post by:
Hi all. Does id() xpath function work in System.XML? I have built dtd, schema, xdr for a simple xml which includes attributes definded as ID and IDREFS. Validation is occurring properly for all the types of metadata, but the id() function applied to the IDREFS attribute allways returns nothing. I have tried it from xslt and using the XmlNode.selectnodes or XPathNavigator.Select nada zilch
1
17136
by: Martin Honnen | last post by:
With both .NET 1.0 and 1.1 I have found the following strange behaviour where System.Xml.XmlDocument.LoadXml doesn't throw an error when parsing a text node with a character reference to an invalid characters like . Using the CreateTextNode method I create a text node containing "\u0001a" (C# string literal notation). As far as I understand the DOM allows that and an implementation is not required to throw an error. When OuterXml is...
5
8066
by: Paul Nations | last post by:
I'm in a real pickle. I've inherited a project with major problems. It receives encrypted XML files from a website not under my control (so I can't modify the web app) for insertion into a database. I'm under intense pressure to get the data into the database NOW. I can decrypt the files alright and they look like xml, they'll import into Access 2K3 with no problem, but VB.Net will not read them. It's complaining about no root...
0
3292
by: Franck | last post by:
Hello, here is my basic dtd <!ELEMENT TREENODES (treenode*)> <!ELEMENT treenode (treenode*)> <!ATTLIST treenode Text (#PCDATA) #REQUIRED Level (#PCDATA) #REQUIRED NodeData (#PCDATA) #REQUIRED>
0
3342
by: Frederico Guimar?es via DotNetMonster.com | last post by:
Hi, I'm trying to use the Microsoft.Web.Services2.Messaging. ISoapFormatter but I receive this error: System.Xml.XmlException: The root element is missing. at System.Xml.XmlTextReader.Read() at Microsoft.Web.Services2.Xml.XmlSkipDTDReader.Read() at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
1
5756
by: Tomas | last post by:
When I try to load my xslt i get an xml exception with the message "Root element is missing". The stylesheet works when I preview it in stylus studio, but apparently not in my application. Any ideas what may be wrong? The stylesheet: <?xml version="1.0" encoding="utf-8"?> <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output indent="yes"/>
2
4501
by: =?Utf-8?B?TmF0aGFuIFdpZWdtYW4=?= | last post by:
Hi, I am wondering why the .NET Framework is quite different from Win32 API when it comes to displaying system modal message boxes. Consider the four following types of system modal message boxes (please see associated source code below): 1) Win32 API with context ("btnWin32WithContext_Click") 2) .NET Framework with context ("btnFrameworkWithContext_Click") 3) Win32 API withOUT context ("btnWin32WithOUTContext_Click")
1
11578
by: ayemyat | last post by:
Hi All, I have a remoting service which consumes the web service in another server. I have the following exception throw by the web service. System.Xml.XmlException: The data at the root level is invalid. Line 1, position 1. There is an error in XML document (0, 0). &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;MSVBalanceEnquiry xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt; ...
3
3535
by: =?Utf-8?B?RWQgS3JhbWVy?= | last post by:
I thought this might be useful for someone... I was doing a little work earlier using an Xmldocument class to create & maintain a minor store of data in Xml format. I'd gotten the whole thing up and going and I decided to start testing 'disaster' scenarios. For example, you start up but your file has been deleted, or you try to save and the file is read only. Or you lack write permissions. Or you try to load
0
8987
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
8826
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,...
1
9316
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,...
0
8239
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
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
4597
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
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2211
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.