title: Why doesn't my C# code get a return value from my Oracle function?
body: <p>I am trying to check if a user is in my database, my return value from my function is either a 't' or an 'f'. as below:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION LOGIN
      (p_Naam in varchar2
      ,p_Wachtwoord in varchar2)
      return varchar2
  is
      v_count number;
  BEGIN
      select count(*) into v_count
      from Lid
      where Naam = p_Naam 
      and Wachtwoord = p_Wachtwoord;
      if v_count &gt; 0 then
          return 't';
      end if;
      return 'f';
  END LOGIN;
  </code></pre>
  
  <p>now i call this function with my C# code as below:</p>
  
  <pre><code>public bool LogIn(string gebruikersnaam, string wachtwoord)
      {
          string s;
  
          var cmd = new OracleCommand
          {
              Connection = conn,
              CommandText = "Login",
              CommandType = CommandType.StoredProcedure
          };
  
          cmd.Parameters.Add("p_Naam", OracleDbType.Varchar2).Value = gebruikersnaam;
          cmd.Parameters.Add("p_Wachtwoord", OracleDbType.Varchar2).Value = wachtwoord;
          cmd.Parameters.Add("return_value", OracleDbType.Varchar2, ParameterDirection.ReturnValue);
  
          try
          {
              conn.Open();
              cmd.ExecuteNonQuery();
              s = cmd.Parameters["return_value"].Value.ToString();
          }
          finally
          {
              conn.Close();
          }
  
          return s == "t";
      }
  </code></pre>
  
  <p>when i try this funcion within my oracle developer i get an output.
  only in my C# code, s always comes out as ""</p>
  
  <p>in my sql developer the following gives me 't'</p>
  
  <pre><code>BEGIN
    dbms_output.put_line(LOGIN('Willem Koonings', 'willem'));
  END;
  </code></pre>