none
' ' is an unexpected token. The expected token is '"' or '''. Line 1, position 15. RRS feed

  • Question

  • I am getting this error :

    ' ' is an unexpected token. The expected token is '"' or '''. Line 1, position 15.

    on line Big SmilesOrders.ReadXml(path);

    the value of path is:"C:\\orders\\Orders.xml"

     

    any help pls

     

    private void fswOrders_Created(object sender, FileSystemEventArgs e)

    {

    string path = e.FullPath;

    DataSet dsOrders = new DataSet();

    dsOrders.ReadXml(path); // ERROR HERE

    string strCn = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Nwind.mdb";

    string strOrderQuery = "SELECT * FROM Orders";

    OleDbDataAdapter da = new OleDbDataAdapter(strOrderQuery, strCn);

    Tuesday, July 17, 2007 3:58 PM

Answers

  • That line is telling you there is something wrong with your XML file.  Likely an invalid character for XML somewhere (like a < where it shouldn't be or something)

    looks like your planning to fill the dataset from a database anyway, so is there a reason you're  filling (or trying to fill) it with an XML document?

    -mwalts
    • Proposed as answer by namwam Tuesday, June 26, 2012 5:50 PM
    • Marked as answer by Val MazurModerator Wednesday, July 4, 2012 7:45 PM
    Tuesday, July 17, 2007 4:42 PM

All replies

  • That line is telling you there is something wrong with your XML file.  Likely an invalid character for XML somewhere (like a < where it shouldn't be or something)

    looks like your planning to fill the dataset from a database anyway, so is there a reason you're  filling (or trying to fill) it with an XML document?

    -mwalts
    • Proposed as answer by namwam Tuesday, June 26, 2012 5:50 PM
    • Marked as answer by Val MazurModerator Wednesday, July 4, 2012 7:45 PM
    Tuesday, July 17, 2007 4:42 PM
  • John,

    The error message is a bit misleading as it makes you think there is something wrong with the path of the file. But, in fact, as mwalts has correctly pointed out, this error is occurring not because something is wrong with your XML file path but because your XML file doesn't seem to be well formed. I was getting the same error. But then I Binged for a solution and, after reading the response from mwalts, I found out that my XML file had an illegal character. After replacing the illegal character with a proper character from XML file, the error was gone.

    Thanks..Nam


    • Edited by namwam Tuesday, June 26, 2012 6:01 PM
    Tuesday, June 26, 2012 5:58 PM