Sep 13, 2011, 3:26 PM
Load ext:XmlReader using datasource from code behind
Does this code (below) work? I was reading a post from back in 2008 which suggested datasource binding was not possible unless the source was pure xml. The return from my sp is using a sql query with FOR XML which returns an xml element and my return type in LINQ is set to XElement. Which makes the source pure xml. The store is bound without error but the store appears to be without data.
'Codebehind
Dim ldxml As LINQDocumentDataDataContext = New LINQDocumentDataDataContext(MyConnectionString)
Dim xmlResults = ldxml.ebs_GetDataAsXMLElement(ID)
XMLStore.DataSource = xmlResults
XMLStore.DataBind()
'Page
<ext:Store ID="XMLStore" runat="server">
<Reader>
<ext:XmlReader>
</ext:XmlReader>
</Reader>
</ext:Store>
'Codebehind
Dim ldxml As LINQDocumentDataDataContext = New LINQDocumentDataDataContext(MyConnectionString)
Dim xmlResults = ldxml.ebs_GetDataAsXMLElement(ID)
XMLStore.DataSource = xmlResults
XMLStore.DataBind()
'Page
<ext:Store ID="XMLStore" runat="server">
<Reader>
<ext:XmlReader>
</ext:XmlReader>
</Reader>
</ext:Store>
Last edited by ctallos; Sep 13, 2011 at 3:27 PM.
Reason: Missing some points