Sorry...the problem was that I am stupid.
Didn't initialize the second dataset.
SummaryDataSet = new DataSet() fixed the problem
[quoted text, click to view] Ruprict wrote:
> I am trying to transform a dataset with xslt, and it continually fails
> with a NullReference Exception after the transform when I try to read
> the result into another dataset I have tested the XML and stylesheet,
> so you can assume (ahem) that they are valid. I am using 1.1
>
>
> The code is below:
>
> Dim sre As System.IO.StringReader = New
> System.IO.StringReader(ResultsDataSet.GetXml())
>
> Dim xt As New XmlTextReader(sre)
> Dim xp As New XmlDataDocument(ResultsDataSet)
>
>
> Dim file As String = "/CMPDNet/support/xslt/"
> If lyrName.ToLower = "reported incidents" Then
> file += "IncidentsSummary.xsl"
> Else
> file += "CallSummary.xsl"
> End If
>
>
> Dim xslTran As New System.Xml.Xsl.XslTransform
>
> xslTran.Load(Server.MapPath(file))
> Dim resolver As XmlUrlResolver = New XmlUrlResolver
> Dim xmlReader As XmlReader
>
> xmlReader = xslTran.Transform(xp, Nothing, resolver)
> Dim xmldoc As XmlDocument = New XmlDocument
> xmldoc.Load(xmlReader)
> SummaryDataSet.ReadXml(xmlReader) 'EXCEPTION HAPPENS HERE
>