title: ODP.NET VB.Net calling a stored procedure and returning a refCursor
body: <p>This problem has driven me mad for over a day now. I can create a connection to the database, I can execute sql and return results from that but I can't seem to call a stored Procedure. Here is the code</p>
  
  <pre><code>    Dim myCMD As New OracleCommand
      Dim TheDataReader as New OracleDataReader
  
      myConnection1.Open()
  
      myCMD.Connection = myConnection1
      myCMD.CommandType = CommandType.StoredProcedure
      myCMD.CommandText = "WS_DATA_LAYER.select_user_groups"
  
      myCMD.Parameters.Add(New OracleParameter("id_user", OracleDbType.VarChar2)).Value = "TXA"
      myCMD.Parameters.Add(New OracleParameter("ws_rs", OracleDbType.RefCursor)).Direction = ParameterDirection.Output
  
      ' Tried every single execute function here and none have worked
      ' Either error is thrown or empty refcursor
      myCMD.ExecuteScalar()
  
      TheDataReader = myCMD.Parameters(1).Value().GetDataReader()
  </code></pre>
  
  <p>The Problem lies in ExecuteScalar at the moment. It's throwing an exception called "Input string was not in a correct format". I've tried passing the string with Oracle single quotes and get the same thing. If I use </p>
  
  <pre><code>    TheDataReader = myCMD.ExecuteQuery()
  </code></pre>
  
  <p>it works ok but no results are returned. I've verified that the procedure returns results for the user I'm logged in as. When the query was executing I could see a refcursor in there but it was empty. I must be going mad.</p>
  
  <p>Any help is appreciated</p>