LINQ to XML error in vb.net when reading using XDOCUMENT.

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi All,
<span style="white-space:pre mappingDoc = XDocument.Load(System.Configuration.ConfigurationManager.AppSettings("path"))
<span style="white-space:pre Dim mapXmlRead
<span style="white-space:pre Dim genrcOrClintspecfc = (From c In mappingDoc.Descendants("Entity") Where c.Attribute("Source").Value = publishEntity
Select New With
{
.EntityTarget = c.Attributes("TargetInsUpd")
})
If genrcOrClintspecfc IsNot Nothing AndAlso genrcOrClintspecfc.Count > 1 Then
mapXmlRead = (From c In mappingDoc.Descendants("Entity") Where c.Attribute("Source").Value = publishEntity AndAlso c.Attribute("Mode").Value = "ClientSpecific"
<span style="white-space:pre Select New With
<span style="white-space:pre {

<span style="white-space:pre .Property = c.Elements("Properties").Elements("Property")

})
<span style="white-space:pre Else
mapXmlRead = (From c In mappingDoc.Descendants("Entity") Where c.Attribute("Source").Value = publishEntity
<span style="white-space:pre Select New With
<span style="white-space:pre {

.Property = c.Elements("Properties").Elements("Property")

})
End If
Dim PrimaryKeyNames = From keyItem In <span style="text-decoration:underline
mapXmlRead(0).Property Where keyItem.Attribute("Source").Value.ToString.Trim = "KnowledgeItemId"
ERROR is:Expression of type Object is not queryable. Make sure you are not missing an assembly reference and/or namespace import for the LINQ provider.
How can I solve this?
Regards,
JN
<br/>

View the full article
 
Back
Top