从oracle过程获取行参数到.net [英] get row paramter from oracle procedure to .net
本文介绍了从oracle过程获取行参数到.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我在数据库中创建了此过程
Hi everyone,
I created this procedure in database
CREATE OR REPLACE PROCEDURE GET_ROW(EMP_ROW in out EMP%ROWTYPE)
as
begin
select * into emp_row
from emp
where empno=7934;
end;
我有一个表格c#
and I have a form c#
using Oracle.DataAccess .Client ;
public partial class Form1 : Form
{
OracleConnection conn = new OracleConnection("Password=tiger;Persist Security Info=True;User ID=scott;Data Source=localhost/orcl");
OracleCommand cmd = new OracleCommand();
DataTable tbl;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GET_ROW";
cmd.Parameters.Add("EMP_ROW" , OracleDbType . );
cmd.Parameters["EMP_ROW"].Direction = ParameterDirection.Output ;
cmd.Connection = conn;
//cmd.Parameters.Add(p);
tbl = new DataTable();
conn.Open();
tbl.Load(cmd.ExecuteReader () );
conn.Clone();
gridControl1.DataSource = tbl;
}
推荐答案
要找出答案,请在方法末尾放置一个断点,然后在调试器下运行代码.
To find out, put a breakpoint at the end of the method, and run the code under the debugger.
这篇关于从oracle过程获取行参数到.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文