title: How to get data from table-valued function?
body: <p>I'm looking for another solution to get data from table-valued function.</p>
  
  <p>I'm currently using </p>
  
  <pre><code>dbCommand.CommandText = "select * from My_function(param1, param2)";
  dbCommand.CommandType = CommandType.Text;
  </code></pre>
  
  <p>but I need the solution without using query e.g.</p>
  
  <pre><code>dbCommand.CommandText = "My_function";
  dbCommand.CommandType = CommandType.StoredProcedure;
  dbCommand.Parameters.AddRange(parameters);
  </code></pre>
  
  <p>Unfortunately above returns an error</p>
  
  <blockquote>
    <p>System.Data.SqlClient.SqlException : The request for procedure 'My_function' failed because 'My_function' is a table valued function object.</p>
  </blockquote>