[tt]Please set DataSet.EnforceConstraints == false before trying to edit XmlDataDocument using XML operations[/tt]
I am receiving this error when I attempt to add attributes to the root node in asp.net.
The error occurs on the line [tt].SetAttribute("Begin", txtB.Text)[/tt].
The xml is created from a dataset consisting of 2 linked tables. I want to add attributes to the root node to display in the footer of my report.
Jason Meckley
Database Analyst
WITF
I am receiving this error when I attempt to add attributes to the root node in asp.net.
Code:
Private Sub ViewReport(ByVal Info As DataSet, ByVal xslFile As String, ByVal fPath As String)
Dim xml As New XmlDataDocument(Info)
Dim xsl As New Xsl.XslTransform
Dim writer As New XmlTextWriter(fPath, System.Text.Encoding.UTF8)
With xml.DocumentElement
.SetAttribute("Begin", txtB.Text)
.SetAttribute("End", txtE.Text)
.SetAttribute("User", User.Identity.Name)
.SetAttribute("Date", Date.Now)
End With
Try
xsl.Load(xslFile)
xsl.Transform(xml, Nothing, writer, Nothing)
Response.Redirect(fPath, False)
Catch ex As Exception
Response.Write(ex.Message)
Response.Write("<p>")
Response.Write(ex.ToString)
Finally
writer.Close()
End Try
The xml is created from a dataset consisting of 2 linked tables. I want to add attributes to the root node to display in the footer of my report.
Jason Meckley
Database Analyst
WITF