Pulling an XML encoded JPG from an XML SOAP stream and formatting it correctly to place in an sql image field

Has anyone taken an xml encoded jpg from a web service and formatted it; to place it in an sql image type / field

example (not meant to be an actual encoded jpg or code; just an example)

<PHOTO>9YHGDTEGHKLO2389YUD09CHCVSH 8HDHOSDH8WE8H8</PHOTO>

node = selectsinglenode("/PHOTO")
photoString AS String
photoString = node.InnerText

FormattedCorectlyPhoto = <somecode that processes photoString>

DECLARE @photo As Image
Set @photo = FormattedCorrectlyPhoto
INSERT table (aFieldOfTypeImage) VALUES (@photo)

My goal is simply to get the jpg into a newly inserted row in a SQL 2005 table

im still new to .NET and XML for that matter...




Answer this question

Pulling an XML encoded JPG from an XML SOAP stream and formatting it correctly to place in an sql image field

  • PAUL stanley

    you pointed me in the right direction... thanx for the help!

    -Steve



  • tlbong

    See the following code that reads a

    • JPG to XML
    • from XML back to JPG
    • from XML to Database
    • from database back to JPG.

    I hope it helps.

  • Pulling an XML encoded JPG from an XML SOAP stream and formatting it correctly to place in an sql image field