gpt4 book ai didi

c# - 使用 devart dotConnect 调用 Oracle 存储过程

转载 作者:太空宇宙 更新时间:2023-11-03 16:46:44 33 4
gpt4 key购买 nike

我是 Entity Framework 的新手,正在尝试调用 oracle 存储过程,但没有成功。所以这是我的问题:

如何使用devart dotConnect调用oracle存储过程?

例如我有存储过程:

procedure get_problems(res out sys_refcursor) is
begin

open res
for
select id, name
from problems;

end;

然后从 C# 调用:

 using (Entities entities = new Entities())
{
ObjectParameter res = new ObjectParameter("res", typeof(byte[]));
ObjectResult<PROBLEM> problems = entities.SelectAllProblems(res);
}

但它抛出“EntityCommandExecutionException”:

An error occurred while executing the command definition. See the inner exception for details.

这是内部异常:

ORA-06550: line 2, column 3:\nPLS-00306: wrong number or types of arguments in call to 'GET_PROBLEMS'\nORA-06550: line 2, column 3:\nPL/SQL: Statement ignored

我用过

"typeof(byte[])"

作为 ObjectParameter 类型,因为我在 Devart Entity Developer 的生成代码中看到了这一点。

附注顺便问一下,您将如何在大型项目中推荐 dotConnect?

最佳答案

看看this article在我们的博客中。
您可以使用我们的 Forums 联系我们或 Feedback Page .

关于c# - 使用 devart dotConnect 调用 Oracle 存储过程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5674074/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com