Oracle
1. Create an Oracle Stored Procedure
Create or replace procedure proce_test (paramin in varchar2, paramout out varchar2, paraminout in out varchar2)
As
Varparam varchar2 (28 );
Begin
Varparam: = paramin;
Paramout: = varparam | paraminout;
End;
2. Test the Stored Procedure
Declare
Param_out varchar2 (28 );
Param_inout varchar2 (28 );
Begin
Param_inout: = 'ff ';
Proce_test ('dd', param_out, param_inout );
Dbms_output.put_line (param_out );
End;
Test result: ddff
C #
1. Create an Interface
Type
Object Name
Text property value
Button
Button1
Call
Label
Label1
A:
Label
Label2
B:
Label
Label3
Input
Label
Label4
Inputoutput
Label
Label5
TextBox
TextBox1
TextBox
TextBox2
2. display code
(1) In the WebForm4.aspx. cs File
Add the FIELD private OraOprater mOra = null; // OraOprater is the class of the Data Connection layer.
Double-click the "call" button on the interface and write the following code:
Private void button#click (object sender, System. EventArgs e)
{
MOra = new OraOprater ();
Label5.Text = mOra. SpExeFor (TextBox1.Text, TextBox2.Text); // call the Stored Procedure Method
}
(2) code in the data connection layer (OraOprater. cs)
Reference Oracle components
Using System;
Using System. Data;
Using System. Data. OracleClient;
Namespace WebApplication4
{
Public class OraOprater
{
Private OracleConnection conn = null;
Private OracleCommand cmd = null;
Public OraOprater ()
{
String mConn = "data source = ora9i.ora.com; user id = ora; password = ora"; // connect to the database
Conn = new OracleConnection (mConn );
Try
{
Conn. Open ();
Cmd = new OracleCommand ();