怎么调用存储过程 ADO.NET访问Oracle 9i存储过程(上)[8]
ADO.NET访问Oracle 9i存储过程(上)[8]
以下代码执行该过程 根据结果集创建 DataReader 并将 DataReader 的内容输出到控制台
// create connection
OracleConnection conn = new OracleConnection( Data Source=oracledb;
User Id=UserID;Password=Password; );
// create the mand for the stored procedure
OracleCommand cmd = new OracleCommand();
![怎么调用存储过程 ADO.NET访问Oracle 9i存储过程(上)[8]](http://img.zhputi.com/uploads/6453/6453ae76a9cf338ab77427da91507fe126682.jpg)
cmd Connection = conn;
cmd CommandText = SELECT_JOB_HISTORY GetJobHistoryByEmployeeId ;
cmd CommandType = CommandType StoredProcedure;
// add the parameters for the stored procedure including the REF CURSOR
// to retrieve the result set
cmd Parameters Add( p_employee_id OracleType Number) Value = ;
cmd Parameters Add( cur_JobHistory OracleType Cursor) Direction =
ParameterDirection Output;
// open the connection and create the DataReader
conn Open();
OracleDataReader dr = cmd ExecuteReader();
// output the results and close the connection
while(dr Read())
{
for(int i = ; i <dr FieldCount; i++)
Console Write(dr[i] ToString() + ; );
Console WriteLine();
}
conn Close();
lishixinzhi/Article/program/net/201311/15010相关文章
- oppoa59s强制解锁 oppoa59s专卖店刷机多少钱需要什么需要多少钱
- 存储过程的创建 如何使用ADO访问Oracle数据库存储过程
- 批处理是什么意思 剖析 ADO.NET 批处理更新(深入研究数据访问)
- oracle存储过程怎么调用 有关Oracle存储过程的相关问题
- exec存储过程 初学者必读:使用存储过程都有哪些益处
- 建立存储过程的命令是 讲解Sybase存储过程的建立和使用
- java如何调用存储过程 VFP中调用Oracle的存储过程
- 怎么调用存储过程 ADO.NET访问Oracle 9i存储过程(上)[4]
- 编写存储过程的目的是 关于ASP.NET2.0编写扩展存储过程
- sql调用存储过程exec ASP.NET中如何调用存储过程
爱学记

微信收款码
支付宝收款码