Skip to Content
0
Former Member
Jul 11, 2007 at 10:12 AM

Load from xml CSharp

60 Views

Hi all,

I'm trying to write some code in C# and I have a problem with LoadFromXML function. Here's my code:

try

{

System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();

string path;

string refString;

path = Environment.CurrentDirectory;

<b>xmlDoc.LoadXml(path + "
" + fileName); //Exception</b>

refString = xmlDoc.InnerXml;

App.LoadBatchActions(ref refString);

}

catch (Exception ex)

{

Msg("Load from XML failed: " + ex.Message);

}

In bolded line ecpetion appears: "The data at the root level is invalid. Line 1, position 1." . Does anyone know what to do with this?

Regards

Hmg