<?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: object reference not set to an instance of an object</title><link>https://www.infopathdev.com:443/forums/thread/101220.aspx</link><pubDate>Sat, 14 Feb 2015 07:30:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:101220</guid><dc:creator>Indresh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/101220.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=101220</wfw:commentRss><description>yes , that was issue . After modifying it  worked . Thanks a lot .</description></item><item><title>Re: object reference not set to an instance of an object</title><link>https://www.infopathdev.com:443/forums/thread/101213.aspx</link><pubDate>Fri, 13 Feb 2015 19:58:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:101213</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/101213.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=101213</wfw:commentRss><description>&lt;p&gt;My guess is your XPath of ../ID is incorrect. Right click the node in the datasource task pane and select Copy XPath - what is the path to ID? I&amp;#39;m guessing it may &amp;quot;d:ID&amp;quot; so you&amp;#39;d need ../d:ID instead.&lt;/p&gt;</description></item><item><title>object reference not set to an instance of an object</title><link>https://www.infopathdev.com:443/forums/thread/101155.aspx</link><pubDate>Thu, 12 Feb 2015 08:03:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:101155</guid><dc:creator>Indresh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/101155.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=101155</wfw:commentRss><description>In Infopath form , I am writing c# code for list item changed event , My requirement is I need to get the ID of the list item which is modified. I tried it by using 

int id = Int32.Parse(e.Site.SelectSingleNode(&amp;quot;../@d:ID&amp;quot;, NamespaceManager).Value);

I am getting error as -  &amp;quot;object reference not set to an instance of an object&amp;quot;

Code is - 

                                       
 public void TestEmp__Title_Changed(object sender, XmlEventArgs e)
        {
            // Write your code here to change the main data source.
            if (e.Operation == XmlOperation.ValueChange)
            {
                if (e.Site.Name == &amp;quot;d:Title&amp;quot; &amp;amp;&amp;amp; e.OldValue != e.NewValue)
                {
                    // Get the ID of the item to be changed

                   int id = Int32.Parse(e.Site.SelectSingleNode(&amp;quot;../ID&amp;quot;, NamespaceManager).Value);

                 }

            }

When it reaches above step, error gets generated.
Can you tell me what change need to be done. Thanks in advance . 

Regards
Indresh</description></item></channel></rss>