<?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: Infopath Updating a maindata source using Code</title><link>https://www.infopathdev.com:443/forums/thread/41617.aspx</link><pubDate>Wed, 13 May 2009 01:43:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41617</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41617.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=41617</wfw:commentRss><description>&lt;p&gt;Hi Ram,&lt;/p&gt;
&lt;p&gt;If you are not a developer, you should hire one. This is a simple question for a developer. We don&amp;#39;t just work for free here. :) We will answer questions that have been researched and are thoughtful, but if someone just asks 20 questions over the weekend, it sure seems to suggest that they aren&amp;#39;t doing their homework. This website has been around for over 5 years. We have tons of content and forum posts. Please take some time to search the forum and read previous posts first. For general programming questions, please look for examples in Microsoft&amp;#39;s SDK. For really tricky things, please ask us. We&amp;#39;re here to help you, but you need to try to help yourself first. &lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;</description></item><item><title>Infopath Updating a maindata source using Code</title><link>https://www.infopathdev.com:443/forums/thread/41563.aspx</link><pubDate>Tue, 12 May 2009 09:39:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41563</guid><dc:creator>ramakrishna</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41563.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=41563</wfw:commentRss><description>I&amp;#39;m new to Infopath
I am trying to update a field called &amp;#39;prepared_by&amp;#39; using code (infopath 2003).

On the load process I have :
var wshShell = new ActiveXObject(&amp;quot;Wscript.Shell&amp;quot;);
var wshEnv = wshShell.Environment(&amp;quot;Process&amp;quot;);
var username = wshEnv.Item(&amp;quot;UserName&amp;quot;);
(Tested and works great!)

I have a main datasource which update a database on a shared network called : Tbl_Main
I&amp;#39;m using a repeating selection for users to update. 

I tried using:
XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:Prepared_By&amp;quot;).text = username;

But I get a message saying selectSingleNode is null. 

Can someone assist me by telling  me how I can get the Field &amp;#39;Prepared_By&amp;#39; to default or update to my Username reference?</description></item></channel></rss>