R
Rob W
Greetings,
For no shortage of trying I am unable to convert the contents of a datarow
(containing xml data) to type string, using .tostring results in conversion
errors in the linq and when adding
adding as an xml element to an xmldocument the literal words systems.data
(see code below for examples).
Is it possible from the linq to extract the datatable rows containg xml and
then write them to an xmldocument as xmlelements?
LINQ Code:-
Dim quotes = From quote In
frmMainQuote.quoteData.Tables("quote").AsEnumerable _
Select quote _
Where (quote.Item("category").ToString = cboCategory.SelectedItem.ToString)
_
And (quote.Item("author").ToString = txtAuthor.Text) _
And (quote.Item("text").ToString Like "*" & txtKeyword.Text & "*") _
And (quote.Item("date").ToString = dtpQuoteDate.Value.ToString("dd MMMM
yyyy"))
'WRITE OUT xmlElement to an xmlDocument:-
Dim outQuoteDoc As New XDocument(New XElement("quotefile", quotes))
'Or
Dim outQuoteDoc As New XDocument(New XElement("quotefile", quotes.tostring))
Thanks
Rob
For no shortage of trying I am unable to convert the contents of a datarow
(containing xml data) to type string, using .tostring results in conversion
errors in the linq and when adding
adding as an xml element to an xmldocument the literal words systems.data
(see code below for examples).
Is it possible from the linq to extract the datatable rows containg xml and
then write them to an xmldocument as xmlelements?
LINQ Code:-
Dim quotes = From quote In
frmMainQuote.quoteData.Tables("quote").AsEnumerable _
Select quote _
Where (quote.Item("category").ToString = cboCategory.SelectedItem.ToString)
_
And (quote.Item("author").ToString = txtAuthor.Text) _
And (quote.Item("text").ToString Like "*" & txtKeyword.Text & "*") _
And (quote.Item("date").ToString = dtpQuoteDate.Value.ToString("dd MMMM
yyyy"))
'WRITE OUT xmlElement to an xmlDocument:-
Dim outQuoteDoc As New XDocument(New XElement("quotefile", quotes))
'Or
Dim outQuoteDoc As New XDocument(New XElement("quotefile", quotes.tostring))
Thanks
Rob