Its NOT a text file, its a 'text' value in a SQL Server table.
I have a (SQL Server 2005) table with a field (defined as TEXT) that contains
an XML document. In VB.NET (VS 2005) I need to get this xml document and
perform XPath statements on it. When I get the XML document and convert it
to a string I loose part of the document.
Dim xmltext As New System.Text.Str ingBuilder
Dim strReader As StringReader = New StringReader(xm ltext.ToString)
Dim reader As XmlTextReader = New XmlTextReader(s trReader)
Dim strSQL As New System.Text.Str ingBuilder
strSQL.Append(" SELECT msg as VAL from tblMessage WHERE ID=100")
'routine ExecSQLReturnVa l executes a SQL statements are returns VAL
xmltext.Append( ExecSQLReturnVa l(strSQL.ToStri ng))
strReader = New StringReader(xm ltext.ToString)
reader = New XmlTextReader(s trReader)
docNav = New XPathDocument(r eader)
now 'xmltext' does not have the full XML document, it has been cut off
Scott, Do you have an example in VB.NET to load the text?
"Scott M." wrote:
Load the text file into an XMLDocument and use XPath from there?
"Joe Pannone" <Jo********@dis cussions.micros oft.com> wrote in message
news:53******** *************** ***********@mic rosoft.com... Does anyone have an example on using an XPath statement (in VB.NET) where
the
source XML document is NOT a file, but a 'text' value from SQL Server?