首页 > 代码库 > C#通过OleDb查询Oracle存储过程
C#通过OleDb查询Oracle存储过程
using System; using System.Data; using System.Data.OleDb;
/// <summary> /// 通过OleDb查询Oracle存储过程 /// </summary> /// <param name="id"></param> /// <returns></returns> public static DataTable getTodoList(string id) { string connString1 = "provider=OraOLEDB.Oracle.1;User ID=test;Password=test;Data Source=(DESCRIPTION = (ADDRESS_LIST= (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))) (CONNECT_DATA = http://www.mamicode.com/(SERVICE_NAME = orcl)));Persist Security Info=True;Extended Properties=‘PLSQLRSet=1‘;";//‘PLSQLRSet=1‘很重要 DataSet ds = new DataSet(); DataTable dt = new DataTable(); OleDbConnection conn = new OleDbConnection(connString1); OleDbCommand cmd = new OleDbCommand("getTodoList", conn); cmd.CommandType = CommandType.StoredProcedure; try { conn.Open(); OleDbParameter[] parms = { new OleDbParameter("id1", OleDbType .VarChar) }; parms[0].Value = http://www.mamicode.com/id;>
C#通过OleDb查询Oracle存储过程
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。