title: Sitecore.Context.Database.GetItem() not working in sitecore events
body: <p>I am using <code>Sitecore 7.0</code>. <code>Visual Studio 2013</code>. I want to create an item's child in Sitecore using event Handler. So whenever an item is created, its child automatically added. For this I wrote an eventHandler on "<code>item:added</code>" event. </p>
  
  <p>But I am getting <code>NullReferenceException</code> exception "<code>Exception Details: System.NullReferenceException: Object reference not set to an instance of an object</code>."</p>
  
  <p>I figure out that <code>Database.GetItem()</code> method is not working in Sitecore Events.</p>
  
  <pre><code>Item entryFolderItem = Sitecore.Context.Database.GetItem("/sitecore/content/Site Config/Configuration/Entry Folders Structure");
  </code></pre>
  
  <p>The above item exist in sitecore and I have also tried with <code>ID</code>. But still I get the same error. </p>
  
  <p>I also tried the same code on event <code>item:saved</code> but still I get the same error. </p>
  
  <p>Any suggestion for this problem!!</p>
  
  <p>By the way <a href="https://csuwannarat.wordpress.com/2011/08/10/trigger-field-update-with-custom-event-handler-itemsaved/" rel="nofollow">here</a> you can find a nice article on events.   </p>