How to read XML data from a table

  • Hi All,

    I have table with columns TypeId(int) & Description(ntext datatype).

    The Description column has XML file content as value in the table.

    Now i want to read the data into a dataset in VB.Net. Is it possible to do it the SQL side.

    Please help me.

  • Get the XML into a string variable on the VB.NET side and then use:

    Dim objDS As DataSet

    Dim objXMLReader As StringReader

    Dim strXML As String

    objXMLReader = New StringReader(strXML)

    objDS = New DataSet

    objDS.ReadXml(objXMLReader)

  • Hi

    In addition to the above, When you store XML in nText datatype do you validate this in any Business Layer with a XSD?

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply