Skip to content

System.Xml.XmlException: Unexpected end tag #3319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kstrohminfor opened this issue May 1, 2025 · 1 comment
Open

System.Xml.XmlException: Unexpected end tag #3319

kstrohminfor opened this issue May 1, 2025 · 1 comment
Assignees
Labels
Triage Needed 🆕 For new issues, not triaged yet.
Milestone

Comments

@kstrohminfor
Copy link

kstrohminfor commented May 1, 2025

Describe the bug

Unable to iterate through results with an xml column with a sql reader.

System.Xml.XmlException: Unexpected end tag. Line 1, position 13.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlWriter.WriteNode(XmlReader reader, Boolean defattr)
   at System.Data.SqlTypes.SqlXml.get_Value()
   at Microsoft.Data.SqlClient.SqlCachedBuffer.ToString()
   at Microsoft.Data.SqlClient.SqlBuffer.get_String()
   at Microsoft.Data.SqlClient.SqlDataReader.GetString(Int32 i)

To reproduce

https://github.com/kstrohminfor/SqlReaderIssue

Expected behavior

The sql reader should be able to iterate through results with an xml column without error.

Further technical details

Microsoft.Data.SqlClient version: 6.1.0-preview1.25120.4
.NET target: .NET 8.0
SQL Server version: 2022
Operating system: Windows 11

@Wraith2
Copy link
Contributor

Wraith2 commented May 1, 2025

This is an issue discovered using preview 6.1 with the new async handling enabled. We discussed it on discord and verified that using the configuration switch to disable async-continue fixes it. I will investigate.

@cheenamalhotra cheenamalhotra added this to the 6.1-preview2 milestone May 2, 2025
@cheenamalhotra cheenamalhotra added the Triage Needed 🆕 For new issues, not triaged yet. label May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triage Needed 🆕 For new issues, not triaged yet.
Projects
None yet
Development

No branches or pull requests

3 participants