System.Xml.XmlException: The root element is missing.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.xsd"
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top