<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: programmatically set a base64 from image</title><link>https://www.infopathdev.com:443/forums/thread/32519.aspx</link><pubDate>Wed, 24 Sep 2008 20:04:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32519</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32519.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32519</wfw:commentRss><description>&lt;p&gt;Hi--&lt;/p&gt;
&lt;p&gt;Your picture node has the xsi:nil attribute on it, I&amp;#39;ll bet, and you&amp;#39;ll need to remove that to set its value and not get an error.&lt;/p&gt;
&lt;p&gt;Try these links for some samples:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb509311.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb509311.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://community.sgdotnet.org/blogs/kitkai/archive/2007/06/03/Keep-forgetting-that-xsi_3A00_nil-causes-schema-validation-found-non_2D00_data-type-errors.aspx"&gt;http://community.sgdotnet.org/blogs/kitkai/archive/2007/06/03/Keep-forgetting-that-xsi_3A00_nil-causes-schema-validation-found-non_2D00_data-type-errors.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hope that helps....&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>programmatically set a base64 from image</title><link>https://www.infopathdev.com:443/forums/thread/32429.aspx</link><pubDate>Mon, 22 Sep 2008 17:12:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32429</guid><dc:creator>tripleGun</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32429.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32429</wfw:commentRss><description>&lt;p&gt;Hello all!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I am having quite a bit of trouble programmatically setting the value of a picture in InfoPath 2007.&lt;/p&gt;
&lt;p&gt;Here is what I am doing:&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; myImage &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Image&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;myImage = Image.FromFile(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;C:/Temp/tempPic.gif&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; memory &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;New&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; IO.MemoryStream()&lt;br /&gt;myImage.Save(memory, myImage.RawFormat)&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; base64 &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;base64 = Convert.ToBase64String(memory.ToArray())&lt;br /&gt;memory.Close()&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:myFields/my:field2&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(base64)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;I get this error:&lt;/p&gt;
&lt;p&gt;Schema validation found non-data type errors.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I&amp;#39;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?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you so much!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;jax&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>