title: Object reference not set to an instance of an object.
body: <p>I keep getting this error when I run the program.</p>
  
  <blockquote>
    <p>Object reference not set to an instance of an object. 
    Description: An unhandled 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.</p>
  </blockquote>
  
  <pre><code>Source Error:
  
  Line with error:
  
  Line 156:        if (strSearch == "" || strSearch.Trim().Length == 0)
  </code></pre>
  
  <p>What is the correct way it should be written?</p>