XmlReader::ReadElementString Method
Reads the simple text-only elements. However, we recommend that you use the ReadElementContentAsString method instead, because it provides a more straightforward way to handle this operation.
Assembly: System.Xml (in System.Xml.dll)
| Name | Description | |
|---|---|---|
![]() | ReadElementString() | Reads a text-only element. However, we recommend that you use the ReadElementContentAsString() method instead, because it provides a more straightforward way to handle this operation. |
![]() | ReadElementString(String^) | Checks that the Name property of the element found matches the given string before reading a text-only element. However, we recommend that you use the ReadElementContentAsString() method instead, because it provides a more straightforward way to handle this operation. |
![]() | ReadElementString(String^, String^) | Checks that the LocalName and NamespaceURI properties of the element found matches the given strings before reading a text-only element. However, we recommend that you use the ReadElementContentAsString(String^, String^) method instead, because it provides a more straightforward way to handle this operation. |
| Exception | Condition |
|---|---|
| InvalidOperationException | An XmlReader method was called before a previous asynchronous operation finished. In this case, InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.” |
We recommend that you use the ReadElementContentAsString method to read a text element.
