T
tshad
I have the following code:
string myXMLfile = strFile;
DataSet ds1 = new DataSet();
// Create new FileStream with which to read the schema.
System.IO.FileStream fsReadXml = new System.IO.FileStream
(myXMLfile, System.IO.FileMode.Open);
try
{
ds1.ReadXml(fsReadXml);
}
....
I am getting an error reading the file:
"Invalid character in the given encoding. Line 3, position 1."
The start of the XML file is:
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com
ffice:spreadsheet"
xmlns
="urn:schemas-microsoft-com
ffice
ffice"
xmlns:x="urn:schemas-microsoft-com
ffice:excel"
xmlns:ss="urn:schemas-microsoft-com
ffice:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com
ffice
ffice">
Looks fine to me.
What would cause this error?
Excel reads it perfectly.
Thanks,
Tom
string myXMLfile = strFile;
DataSet ds1 = new DataSet();
// Create new FileStream with which to read the schema.
System.IO.FileStream fsReadXml = new System.IO.FileStream
(myXMLfile, System.IO.FileMode.Open);
try
{
ds1.ReadXml(fsReadXml);
}
....
I am getting an error reading the file:
"Invalid character in the given encoding. Line 3, position 1."
The start of the XML file is:
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com
![Blush :o :o](/styles/default/custom/smilies/blush.gif)
xmlns
![Blush :o :o](/styles/default/custom/smilies/blush.gif)
![Blush :o :o](/styles/default/custom/smilies/blush.gif)
![Blush :o :o](/styles/default/custom/smilies/blush.gif)
xmlns:x="urn:schemas-microsoft-com
![Blush :o :o](/styles/default/custom/smilies/blush.gif)
xmlns:ss="urn:schemas-microsoft-com
![Blush :o :o](/styles/default/custom/smilies/blush.gif)
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com
![Blush :o :o](/styles/default/custom/smilies/blush.gif)
![Blush :o :o](/styles/default/custom/smilies/blush.gif)
Looks fine to me.
What would cause this error?
Excel reads it perfectly.
Thanks,
Tom