Hi Andrew,
This error means Reader.ReadToFollowing("Email") cannot find the correct
element. Reader will stop at the end of your file. For this reason,
ReadElementContentAsString will throw System.InvalidOperationException: The
ReadElementContentAsString method is not supported on node type None.
Have you checked whether there an element named "Email" in your XML file?
Be careful of the case sensitive.
Additionally, ReadToFollowing() method will return a bool value. If this
method has located the element, it will be true, otherwise, it will be
false.
I recommend you may make some change in your code to narrow-down the issue.
while (reader.Read())
{
// Move to the Email element.
bool flag= reader.ReadToFollowing("Email");
if (flag)
{
string email = reader.ReadElementContentAsString();
.......
}
......
Hope this helps.Please let me know if you have any further issue on this.
I'm glad to assist you.
Have a great day,
Sincerely,
Wen Yuan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.