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

System.Xml.XmlException: 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:\Documents and
Settings\marc.mcguckian\My Documents\Visual Studio Projects\MIS RECON
Engine\MISRE_XMLSchema.xsd"
Dim fileName As String =
"F:\QDIMIS_RECON_Logs\config\MISRE_XMLSchema.x sd"
If Not File.Exists(fileName) Then
MessageBox.Show("The configuration Setup cannot be found, Please
re-install application and try again", "MIS RECON Engine",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Return -1
End If

Dim fs As FileStream = New FileStream(fileName, FileMode.Open,
FileAccess.Read)
Dim xtr As XmlTextReader = New XmlTextReader(fs)
dsSettings = New DataSet
Try
dsSettings.ReadXmlSchema(xtr)
Catch ex As XmlException
MessageBox.Show(ex.ToString)
End Try

xtr.Close()

End Function

Nov 21 '05 #1
1 9392
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:\Documents and
Settings\marc.mcguckian\My Documents\Visual Studio Projects\MIS RECON
Engine\MISRE_XMLSchema.xsd"
Dim fileName As String =
"F:\QDIMIS_RECON_Logs\config\MISRE_XMLSchema.x sd"
If Not File.Exists(fileName) Then
MessageBox.Show("The configuration Setup cannot be found, Please
re-install application and try again", "MIS RECON Engine",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Return -1
End If

Dim fs As FileStream = New FileStream(fileName, FileMode.Open,
FileAccess.Read)
Dim xtr As XmlTextReader = New XmlTextReader(fs)
dsSettings = New DataSet
Try
dsSettings.ReadXmlSchema(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
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...
1
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...
5
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...
0
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) ...
0
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()...
1
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...
2
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...
1
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...
3
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.