Last post Apr 14, 2011 06:57 AM by cenk1536
Apr 12, 2011 07:52 AM|cenk1536|LINK
I m trying to remove the first element of an XML in my web service. Here is the sample code: But the problem is "First is not a member of System.Collections.Generic.IEnumerable(Of System.Xml.Linq.XElement.)"
How can I fix this?
thanks in advance.
Dim doc As XDocument = XDocument.Load("d:\test.xml")'Remove the root Elementdoc.Root.ReplaceWith(doc.Root.Elements.First)
Apr 12, 2011 08:42 AM|rishialagesan|LINK
yes, there is no member called "First" in the Elements collection. thats why you are getting this error.
try using this
Hope that helps.
Apr 12, 2011 08:54 AM|cenk1536|LINK
There is NO FirstNode
Apr 13, 2011 02:11 AM|cenk1536|LINK
I m not sure but is this possible?
Dim doc As XElement = XElement.Load("D:\xml_file_TEST.xml")
Apr 14, 2011 06:57 AM|cenk1536|LINK
I added System.LINQ and its solved.