Oracle Segment: First set up Package and Package Body in Oracle, the function and stored procedure return result set will be defined. 1: Set PACKAGE: CREATE OR REPLACE package SCOTT.pk_wtistype mytype is ref cursor; procedure p_wt (mycs out mytype); function f_get (str in varchar2) return varchar2; end; / Description: In fact, just a statement PACKAGE nothing. We define a stored procedure to return junctions and a function, return a string. 2: establishing PACKAGE BODY: CREATE OR REPLACE package BODY SCOTT.pk_wtisprocedure p_wt (mycs out mytype) isbeginopen mycs for select * from test; end p_wt; function f_get (str varchar2) return varchar2isstr_temp varchar2 (100): '! Good luck' = Beginstr_Temp: = STR_TEMP || Str; RETURN STR_TEMP; END F_GET; END PK_WT; / Description: Create package body is a specific instructions and use, what way it will be implemented. . C # segment: The C # middle code will be divided into two parts, part of the function, and the other part is the use of the result set. Define a connection, obtained from the go WEBCONFIG: private OracleConnection orcn = new OracleConnection (System.Configuration.ConfigurationSettings.AppSettings [ "scott"]); C # function call ORACLE: OracleCommand cmd = new OracleCommand ( "pk_wt.f_get", orcn) ; cmd.CommandType = CommandType.StoredProcedure; OracleParameter p1 = new OracleParameter ( "str", OracleType.VarChar, 10); p1.Direction = System.Data.ParameterDirection.Input; p1.Value = this.TextBox1.Text; OracleParameter p2 = New OracleParameter ("Result", ORACletype.varchar, 100); p2.direction = system.data.parameterDirection.RtrurnValue; cmd.Parameters.Add (P1); cmd.parameters.add (P2); orom = Cmd.executenonQuery (); orom ortton_function.text = p2.value.tostring (); where Result is a system-defined function returns variable, especially note that the return type of the parameters of the function To specify, the Command type also needs to be specified, and the general stored procedure has no difference.