title: Vb.net - Handling null or no values returned from SQL Command object
body: <p>we got this sql query:</p>
  
  <pre><code>Select EmployeeDesignation from Employee where EmployeeName = Paramater1 
  </code></pre>
  
  <p>(Parameter1 is value is passed to this)</p>
  
  <p>We are using this statement:
  lEmployeeDesignation = _SQLCommand.ExecuteScalar()</p>
  
  <p>3 scenario's:</p>
  
  <ol>
  <li>Returns the employee Designation (record exists in table)</li>
  <li>No value is set in database for Parameter1 - so should return NULL (record exists but has no value)</li>
  <li>No employee record exists so returns nothing (record doesn't exists)</li>
  </ol>
  
  <p>I'm struggling with 2 and 3 scenario - incase of Scenario 3 we want the application to fail, but struggling how to trap this error.
  regards</p>