title: IIS7 giving Object reference not set to an instance of an object error
body: <p>I have an IIS7 application that is using the .net 4.0 framework. The application pool has the rights (read/write/execute) on the folder of the application and has (select/read/connect) rights to the Database. IIS7 accept the aspx files and everything seems fine int eh settings however i am getting a 404 error when I am calling ti from outside of the server.</p>
  
  <p>When I go in the server and call the <a href="http://localhost" rel="nofollow">http://localhost</a> link, i get this error</p>
  
  <pre><code>    Server Error in '/Phonebook/PhoneBook' Application.
  --------------------------------------------------------------------------------
  
  Object reference not set to an instance of an object.  
  Description: An unhanded exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
  Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
  
  Source Error: 
  
  An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
  
  Stack Trace: 
  
  
  [NullReferenceException: Object reference not set to an instance of an object.]
     PhoneBookApplication.DBUtils.Execute(SqlCommand command) +399
     PhoneBookApplication._Default.FillddlSearch() +156
     PhoneBookApplication._Default.Page_Load(Object sender, EventArgs e) +54
     System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +24
     System.Web.UI.Control.LoadRecursive() +70
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3047
  
  
  
  
  --------------------------------------------------------------------------------
  Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 
  </code></pre>
  
  <p>If I call a default-defaut.html file, it works, but not if I call the default-defaut.aspx. But in the daufault pages settings, both aspx and html are there.</p>
  
  <p>Also, it seems to have something to do with the sql server, but I do not understand where to look to debug that</p>
  
  <p>I have no idea what is doing this. Can someone help?</p>