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).
The store procedure:
@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
The following library class is what I use to call the stored procedure.
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;
}
Once executed the procedure returns the Boolean value. (In theory)
Last piece of the puzzle is the web service call.
[WebMethod]
public bool Validation(string VC)
{
ValidC c = new ValidC(VC);
if(c. == true)
return true;
else
return false;
}