title: ASP.net Webservice to return boolean value to Page
body: <p>Here is my issue. I have a stored procedure that returns an output that is a bit. I am trying to view the Boolean value via the web service. The stored procedure totally works, but I can't seem to figure out how to display the needed value (which is a boolean). </p>
  
  <p>The store procedure:</p>
  
  <pre><code>@CE_IN VARCHAR(2)
  @return_OUT BIT OUTPUT
  IF EXISTS(SELECT Ce FROM Table A WHERE @CE_IN = Ce)
  BEGIN IF EXISTS(SELECT * FROM Table A)
  set @return_OUT = 1
  ELSE 
  set @return_OUT = 1
  END
  ELSE set @return_OUT = 0
  </code></pre>
  
  <p>The following library class is what I use to call the stored procedure.</p>
  
  <pre><code>public Boolean ValidC(String VC) 
      {
              DbCommand dbCommand = db.GetStoredProcCommand(spName);
  
              db.AddInParameter(dbCommand, "CE_IN", DbType.String, VC);
              db.AddOutParameter(dbCommand, "return_OUT", DbType.Boolean, 1);
              db.ExecuteNonQuery(dbCommand);
  
              return (Boolean)dbCommand.Parameters["@return_OUT"].Value;
      }
  </code></pre>
  
  <p>Once executed the procedure returns the Boolean value. (In theory)</p>
  
  <p>Last piece of the puzzle is the web service call.</p>
  
  <pre><code>[WebMethod]
  public bool Validation(string VC)
       {
           ValidC c = new ValidC(VC);
           if(c. == true)
               return true;
  
           else
               return false;
  
       } 
  </code></pre>