Hello all!
I am having quite a bit of trouble programmatically setting the value of a picture in InfoPath 2007.
Here is what I am doing:
Dim myImage As Image
myImage = Image.FromFile("C:/Temp/tempPic.gif")
Dim memory As New IO.MemoryStream()
myImage.Save(memory, myImage.RawFormat)
Dim base64 As String
base64 = Convert.ToBase64String(memory.ToArray())
memory.Close()
MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:field2", NamespaceManager).SetValue(base64)
I get this error:
Schema validation found non-data type errors.
I'm not sure what the deal is. When I write the same code for a windows app, the image displays just fine. Why am I not able to set the xml base64 value to this converted image?
Thank you so much!
jax