I have a stored procedure which returns a mixture of plain columns, and one 'column' of xml datatype. As in:
Select
Field1,
Field2,
(
SELECT
Certification As '@certification',
LCID As '@lcid'
FROM
dbo.MemberCertifications
FOR XML PATH('certification'), TYPE, ROOT('certifications')
) AS Certifications
FROM
.......
I'm binding this result to a gridview, and I need the xml column to be bound to a nested repeater as it contains parent-child data.
I've tried setting the repeater datasource to the column name, as in:
<asp:Repeater ID="rp" runat="server" DataSource="<%# Eval("Certifications") %>">
<ItemTemplate>
<%#XPath("//@certification")%>
</ItemTemplate>
</asp:Repeater>
but that doesn't work. It seems like it's coming across as a plain string. If I just write a line break inside the ItemTemplate it includes a break for each char in the column!
I've also tried using an xmldatasource inline, but I get a parser error:
<asp:XmlDataSource ID="data_certs" runat="server" >
<%# Eval("Certifications") %>
</asp:XmlDataSource>
I'm at the end of my rope here - I'm at the point where I'm just going to build up my result in code by deserializing the xml. I don't really need any gridview functionality anyway.
Any ideas?